/* OPMI Template CSS - SEO Optimized Design System v2.1 */

/* ========================================
   CSS VARIABLES
======================================== */
:root {
    /* Brand Colors */
    --c-primary: #1A325D;
    --c-accent: #F6921E;
    --c-secondary: #30A826;
    
    /* UI Colors */
    --c-bg-hero: #F0F0F0;
    --c-bg-white: #FFFFFF;
    --c-bg-gray: #F5F5F5;
    --c-text-dark: #333333;
    --c-text-muted: #666666;
    --c-border: #E0E0E0;
    
    /* Typography */
    --font-heading: 'Montserrat', system-ui, sans-serif;
    --font-body: 'Inter', 'Open Sans', system-ui, sans-serif;
    
    /* Spacing */
    --container-max: 1280px;
    --header-height: 72px;
}

/* ========================================
   ACCESSIBILITY - Screen Reader Only
======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only-focusable:focus,
.sr-only-focusable:active {
    position: static;
    width: auto;
    height: auto;
    padding: 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--c-accent);
    color: white;
    text-decoration: none;
    z-index: 9999;
}

/* Focus Styles for Accessibility */
:focus {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

/* ========================================
   RESET & BASE
======================================== */
*, *::before, *::after { 
    box-sizing: border-box; 
    margin: 0;
    padding: 0;
}

html { 
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    color: var(--c-text-dark);
    background: var(--c-bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   TYPOGRAPHY
======================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--c-primary);
}

h1 { font-size: clamp(1.75rem, 4vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }

/* Only one H1 per page */
h1 {
    margin-bottom: 1.5rem;
}

/* Proper heading hierarchy */
h2 { margin-bottom: 1rem; }
h3 { margin-bottom: 0.75rem; }

p {
    color: var(--c-text-dark);
    margin-bottom: 1rem;
}

/* ========================================
   CONTAINER
======================================== */
.opmi-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.25rem;
}

@media (min-width: 768px) {
    .opmi-container { padding: 0 2rem; }
}

@media (min-width: 1200px) {
    .opmi-container { padding: 0 3rem; }
}

/* ========================================
   HEADER & NAVIGATION
======================================== */
.opmi-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--c-border);
}

.opmi-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Logo */
.opmi-logo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    text-decoration: none;
    color: var(--c-primary);
    transition: opacity 0.3s ease;
}

.opmi-logo:hover {
    opacity: 0.85;
}

.opmi-logo img {
    height: 44px;
    width: 44px;
    object-fit: contain;
}

.opmi-logo span {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    color: var(--c-primary);
}

@media (max-width: 767px) {
    .opmi-logo span { display: none; }
}

/* Navigation */
.opmi-nav {
    display: none;
}

@media (min-width: 992px) {
    .opmi-nav {
        display: flex;
        align-items: center;
    }
}

.opmi-nav .nav,
.opmi-nav .mod-menu {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.opmi-nav .nav > li,
.opmi-nav .mod-menu > li {
    position: relative;
    margin: 0;
}

.opmi-nav .nav a,
.opmi-nav .mod-menu a {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--c-primary);
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
}

/* Navigation Hover - Animated Underline */
.opmi-nav .nav a::after,
.opmi-nav .mod-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--c-accent);
    transition: width 0.3s ease;
}

.opmi-nav .nav a:hover::after,
.opmi-nav .mod-menu a:hover::after,
.opmi-nav .nav a.active::after,
.opmi-nav .mod-menu a.active::after {
    width: 100%;
}

.opmi-nav .nav a:hover,
.opmi-nav .mod-menu a:hover {
    color: var(--c-primary);
}

/* Mobile Menu Toggle */
.opmi-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.opmi-mobile-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
}

.opmi-mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--c-primary);
    transition: all 0.3s ease;
}

@media (min-width: 992px) {
    .opmi-mobile-toggle { display: none; }
}

/* Mobile Navigation */
.opmi-mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--c-bg-white);
    border-bottom: 1px solid var(--c-border);
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.opmi-mobile-nav.active {
    display: block;
}

.opmi-mobile-nav .nav,
.opmi-mobile-nav .mod-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.opmi-mobile-nav .nav li,
.opmi-mobile-nav .mod-menu li {
    border-bottom: 1px solid var(--c-border);
}

.opmi-mobile-nav .nav li:last-child,
.opmi-mobile-nav .mod-menu li:last-child {
    border-bottom: none;
}

.opmi-mobile-nav .nav a,
.opmi-mobile-nav .mod-menu a {
    display: block;
    padding: 1rem 0.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9375rem;
    text-transform: uppercase;
    color: var(--c-primary);
    text-decoration: none;
}

/* ========================================
   HERO SECTION
======================================== */
.opmi-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--header-height);
    background: var(--c-bg-hero);
    position: relative;
    overflow: hidden;
}

/* Subtle background pattern */
.opmi-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(26, 50, 93, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(246, 146, 30, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.opmi-hero-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2.5rem;
    padding: 3rem 0;
    position: relative;
    z-index: 1;
}

@media (min-width: 992px) {
    .opmi-hero-grid {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 4rem;
        padding: 4rem 0;
    }
}

/* Hero Content */
.opmi-hero-content {
    order: 2;
    max-width: 640px;
}

@media (min-width: 992px) {
    .opmi-hero-content {
        order: 1;
        flex: 1;
    }
}

.opmi-hero-subtitle {
    font-family: var(--font-heading);
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    font-weight: 600;
    color: var(--c-primary);
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
}

/* Hero Shield */
.opmi-hero-shield {
    order: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (min-width: 992px) {
    .opmi-hero-shield {
        order: 2;
        flex-shrink: 0;
    }
}

.opmi-hero-shield img {
    width: 200px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.15));
    animation: float 6s ease-in-out infinite;
}

@media (min-width: 768px) {
    .opmi-hero-shield img { width: 280px; }
}

@media (min-width: 992px) {
    .opmi-hero-shield img { width: 340px; }
}

@media (min-width: 1200px) {
    .opmi-hero-shield img { width: 400px; }
}

/* Float Animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* Floating Icons */
.opmi-float-icon {
    position: absolute;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.opmi-float-icon.icon-1 {
    width: 56px;
    height: 56px;
    background: var(--c-primary);
    top: -10px;
    left: 10%;
    animation: pulse-icon 3s ease-in-out infinite;
}

.opmi-float-icon.icon-2 {
    width: 48px;
    height: 48px;
    background: var(--c-accent);
    top: 30%;
    right: 0;
    animation: pulse-icon 3s ease-in-out infinite 0.5s;
}

.opmi-float-icon.icon-3 {
    width: 40px;
    height: 40px;
    background: var(--c-secondary);
    bottom: 20px;
    left: 5%;
    animation: pulse-icon 3s ease-in-out infinite 1s;
}

@keyframes pulse-icon {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.9; }
}

@media (max-width: 991px) {
    .opmi-float-icon { display: none; }
}

/* ========================================
   BUTTONS
======================================== */
.btn,
.button,
button.btn,
.readmore a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 1rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

/* Primary Button (Orange) */
.btn-primary,
.button.btn-primary,
.readmore.btn-primary a {
    background: var(--c-accent);
    color: #FFFFFF;
    border-color: var(--c-accent);
    box-shadow: 0 4px 15px rgba(246, 146, 30, 0.3);
}

.btn-primary:hover,
.button.btn-primary:hover,
.readmore.btn-primary a:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(246, 146, 30, 0.4);
    background: #E5851A;
    border-color: #E5851A;
    color: #FFFFFF;
}

/* Secondary/Outline Button */
.btn-outline,
.button.btn-outline,
.readmore.btn-outline a {
    background: transparent;
    color: var(--c-primary);
    border-color: var(--c-primary);
}

.btn-outline:hover,
.button.btn-outline:hover,
.readmore.btn-outline a:hover {
    background: var(--c-primary);
    color: #FFFFFF;
    transform: translateY(-2px);
}

/* Button Group */
.opmi-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

@media (min-width: 576px) {
    .opmi-buttons {
        flex-direction: row;
        justify-content: center;
    }
}

@media (min-width: 992px) {
    .opmi-buttons {
        justify-content: flex-start;
    }
}

/* ========================================
   SECTIONS
======================================== */
.opmi-section {
    padding: 4rem 0;
}

.opmi-section-gray {
    background: var(--c-bg-gray);
}

@media (min-width: 768px) {
    .opmi-section { padding: 5rem 0; }
}

@media (min-width: 1200px) {
    .opmi-section { padding: 6rem 0; }
}

/* Section Titles */
.opmi-section-title {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--c-primary);
}

.opmi-section-subtitle {
    font-size: 1.125rem;
    color: var(--c-text-muted);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* ========================================
   CONTENT GRID & SIDEBAR
======================================== */
.opmi-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .opmi-content-grid.sidebar-left {
        grid-template-columns: 280px 1fr;
    }
    
    .opmi-content-grid.sidebar-right {
        grid-template-columns: 1fr 280px;
    }
    
    .opmi-content-grid.sidebar-both {
        grid-template-columns: 250px 1fr 250px;
    }
}

.opmi-content {
    min-width: 0;
}

/* Article styling for SEO */
.opmi-content article {
    margin-bottom: 2rem;
}

.opmi-content .item-page h1,
.opmi-content .item-page h2 {
    color: var(--c-primary);
}

/* Sidebar */
.opmi-sidebar .moduletable {
    background: var(--c-bg-white);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--c-border);
}

.opmi-sidebar .moduletable h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--c-accent);
}

/* ========================================
   BREADCRUMB
======================================== */
.opmi-breadcrumb {
    background: var(--c-bg-white);
    border-bottom: 1px solid var(--c-border);
    padding: 1rem 0;
}

.opmi-breadcrumb .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.opmi-breadcrumb .breadcrumb li::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--c-border);
}

.opmi-breadcrumb .breadcrumb li:last-child::after {
    display: none;
}

.opmi-breadcrumb .breadcrumb a {
    color: var(--c-text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.opmi-breadcrumb .breadcrumb a:hover {
    color: var(--c-primary);
}

/* ========================================
   FOOTER
======================================== */
.opmi-footer {
    background: var(--c-primary);
    color: #FFFFFF;
    padding: 4rem 0 2rem;
}

.opmi-footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .opmi-footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .opmi-footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 3rem;
    }
}

/* Footer Brand */
.opmi-footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    margin: 1.25rem 0;
    line-height: 1.7;
}

.opmi-footer .opmi-logo span {
    color: #FFFFFF;
}

/* Social Icons */
.opmi-social {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.opmi-social a {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.opmi-social a:hover {
    background: var(--c-accent);
    transform: translateY(-2px);
}

/* Footer Modules */
.opmi-footer .moduletable h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: #FFFFFF;
    margin-bottom: 1.25rem;
}

.opmi-footer .moduletable ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.opmi-footer .moduletable li {
    margin-bottom: 0.75rem;
}

.opmi-footer .moduletable a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.opmi-footer .moduletable a:hover {
    color: var(--c-accent);
}

/* Footer Bottom */
.opmi-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

@media (min-width: 768px) {
    .opmi-footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.opmi-footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
    margin: 0;
}

/* ========================================
   MODULE STYLES
======================================== */
.moduletable {
    margin-bottom: 1.5rem;
}

.moduletable h3 {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--c-primary);
    margin-bottom: 1rem;
}

/* ========================================
   JOOMLA SPECIFIC
======================================== */

/* Messages */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.alert-message { 
    background: #E8F4FD; 
    border-left: 4px solid var(--c-primary); 
    color: var(--c-primary);
}

.alert-success { 
    background: #E8F8E5; 
    border-left: 4px solid var(--c-secondary); 
    color: #1E7A1E;
}

.alert-warning { 
    background: #FFF8E5; 
    border-left: 4px solid #E5A000; 
    color: #8A6D00;
}

.alert-error { 
    background: #FDEDED; 
    border-left: 4px solid #D32F2F; 
    color: #C62828;
}

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 2rem 0;
    padding: 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 0.875rem;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination a {
    background: var(--c-bg-gray);
    color: var(--c-primary);
    border: 1px solid var(--c-border);
}

.pagination a:hover {
    background: var(--c-primary);
    color: #FFFFFF;
    border-color: var(--c-primary);
}

.pagination span.active {
    background: var(--c-accent);
    color: #FFFFFF;
    border: 1px solid var(--c-accent);
}

/* Forms */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    background: var(--c-bg-white);
    color: var(--c-text-dark);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(246, 146, 30, 0.15);
}

label,
.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--c-text-dark);
    margin-bottom: 0.5rem;
}

/* ========================================
   UTILITY CLASSES
======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--c-primary); }
.text-accent { color: var(--c-accent); }
.text-secondary { color: var(--c-secondary); }
.text-muted { color: var(--c-text-muted); }

.bg-primary { background-color: var(--c-primary); }
.bg-accent { background-color: var(--c-accent); }
.bg-secondary { background-color: var(--c-secondary); }
.bg-white { background-color: var(--c-bg-white); }
.bg-gray { background-color: var(--c-bg-gray); }

/* ========================================
   PRINT STYLES - SEO FRIENDLY
======================================== */
@media print {
    /* Hide non-essential elements */
    .opmi-header,
    .opmi-footer,
    .opmi-hero,
    .opmi-sidebar,
    .opmi-breadcrumb,
    .opmi-buttons,
    .opmi-mobile-nav,
    .opmi-mobile-toggle,
    nav,
    .noprint {
        display: none !important;
    }
    
    /* Reset styles for print */
    body {
        font-size: 12pt;
        background: #FFFFFF;
        color: #000000;
    }
    
    /* Ensure content takes full width */
    .opmi-container {
        max-width: 100%;
        padding: 0;
    }
    
    .opmi-content {
        max-width: 100%;
    }
    
    /* Show URLs for links */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    
    /* Don't show URL for internal links */
    a[href^="#"]::after,
    a[href^="javascript"]::after {
        content: "";
    }
    
    /* Ensure images print */
    img {
        max-width: 100%;
        page-break-inside: avoid;
    }
    
    /* Avoid orphans and widows */
    p, h2, h3 {
        orphans: 3;
        widows: 3;
    }
    
    /* Page breaks */
    h2, h3 {
        page-break-after: avoid;
    }
    
    article {
        page-break-inside: avoid;
    }
}

/* ========================================
   REDUCED MOTION - Accessibility
======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
