/**
 * PMF Joomla Template - Responsive Stylesheet
 * Matches the original PMF website responsive behavior
 */

/* ========================================
   LARGE DESKTOP - 1200px and above
   ======================================== */
@media screen and (min-width: 1200px) {
    .container {
        max-width: 1880px;
    }
}

/* ========================================
   TABLET LANDSCAPE - 1024px and below
   ======================================== */
@media screen and (max-width: 1024px) {
    .container {
        max-width: 960px;
        padding: 0 20px;
    }

    .logo img {
        height: 50px;
    }

    .logo-text {
        font-size: 16px;
    }

    .main-navigation > ul > li > a {
        padding: 20px 18px;
        font-size: 13px;
    }

    .hero-section h1 {
        font-size: 48px;
    }

    .hero-section p {
        font-size: 16px;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .certificates-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }

    .sidebar {
        width: 320px;
    }
}

/* ========================================
   TABLET PORTRAIT - 768px and below
   ======================================== */
@media screen and (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    /* Header Adjustments */
    .header-inner {
        padding: 15px 0;
        flex-wrap: wrap;
    }

    .logo {
        flex: 1;
        gap: 10px;
    }

    .logo img {
        height: 40px;
    }

    .logo-text {
        font-size: 12px;
        letter-spacing: 0.5px;
    }

    .top-bar-right {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .top-icons {
        gap: 8px;
    }

    .top-icons a {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    /* Mobile Toggle Visible */
    .mobile-toggle {
        display: flex;
    }

    /* Mobile Navigation - Only menu slides, not header */
    .main-navigation-wrapper {
        position: relative;
        overflow: hidden;
        transition: max-height 0.4s ease;
        max-height: 0;
    }

    .main-navigation-wrapper.active {
        max-height: 800px;
    }

    .main-navigation {
        max-height: none;
        overflow: visible;
    }

    .main-navigation.active {
        max-height: none;
    }

    .main-navigation ul {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .main-navigation li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .main-navigation > ul > li > a {
        padding: 15px 20px;
        width: 100%;
        border-right: none;
        border-left: 3px solid transparent;
    }

    .main-navigation > ul > li:hover > a,
    .main-navigation > ul > li.active > a {
        border-left-color: #fff;
        background: rgba(0,0,0,0.2);
    }

    /* Mobile Dropdowns */
    .main-navigation ul ul {
        position: static;
        display: none;
        box-shadow: none;
        background: rgba(0,0,0,0.2);
        min-width: 100%;
    }

    .main-navigation li.active > ul,
    .main-navigation li:hover > ul {
        display: block;
    }

    .main-navigation ul ul a {
        padding: 12px 20px 12px 40px;
        background: transparent;
        border-left: none;
        font-size: 13px;
    }

    .main-navigation ul ul a:hover {
        background: rgba(0,0,0,0.2);
        padding-left: 45px;
    }

    /* Breadcrumbs with Title */
    .breadcrumbs-wrapper {
        padding: 20px 0;
    }

    .page-title {
        font-size: 26px;
    }

    /* Hero Section */
    .hero-section {
        padding: 80px 0 60px;
        min-height: 400px;
    }

    .hero-section .subtitle {
        font-size: 11px;
        letter-spacing: 2px;
    }

    .hero-section h1 {
        font-size: 38px;
    }

    .hero-section p {
        font-size: 15px;
    }

    .hero-dots {
        bottom: 20px;
        right: 20px;
    }

    .hero-dots span {
        width: 10px;
        height: 10px;
    }

    /* Main Layout */
    .site-main {
        padding: 40px 0;
    }

    .main-row {
        flex-direction: column;
        gap: 30px;
    }

    .main-row.with-sidebar .main-content {
        width: 100%;
    }

    .sidebar {
        width: 100%;
        margin-top: 20px;
    }

    /* Content Typography */
    .main-content h1 {
        font-size: 28px;
    }

    .main-content h2 {
        font-size: 24px;
    }

    .main-content h3 {
        font-size: 20px;
    }

    /* Services Grid */
    .services-section {
        padding: 50px 0;
    }

    .services-section h2 {
        font-size: 28px;
        margin-bottom: 35px;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .service-card img {
        height: 200px;
    }

    .service-card-content {
        padding: 25px;
    }

    /* Certificates */
    .certificates-section {
        padding: 50px 0;
    }

    .certificates-section h2 {
        font-size: 28px;
        margin-bottom: 35px;
    }

    .certificates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .certificate-item {
        padding: 20px 15px;
    }

    .certificate-item img {
        max-height: 120px;
    }

    /* Footer */
    .footer-top {
        padding: 40px 0;
    }

    .site-footer {
        padding: 50px 0 20px;
    }

    .footer-columns {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .footer-col {
        text-align: left;
    }

    .footer-col h3 {
        font-size: 18px;
        margin-bottom: 20px;
    }

    /* Back to Top */
    .back-to-top {
        width: 40px;
        height: 40px;
        line-height: 40px;
        bottom: 20px;
        right: 20px;
    }

    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }
}

/* ========================================
   MOBILE - 480px and below
   ======================================== */
@media screen and (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    /* Header */
    .header-inner {
        padding: 12px 0;
    }

    .logo img {
        height: 35px;
    }

    .logo-text {
        display: none;
    }

    .top-icons a {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    /* Navigation */
    .main-navigation > ul > li > a {
        padding: 14px 15px;
        font-size: 13px;
    }

    /* Hero Section */
    .hero-section {
        padding: 60px 0 50px;
        min-height: 350px;
    }

    .hero-section .subtitle {
        font-size: 10px;
        letter-spacing: 2px;
        margin-bottom: 15px;
    }

    .hero-section h1 {
        font-size: 28px;
        margin-bottom: 20px;
    }

    .hero-section p {
        font-size: 14px;
        line-height: 1.6;
    }

    .hero-dots {
        bottom: 15px;
        right: 15px;
        gap: 8px;
    }

    .hero-dots span {
        width: 8px;
        height: 8px;
    }

    /* Main Content */
    .site-main {
        padding: 30px 0;
    }

    .main-content h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .main-content h2 {
        font-size: 20px;
        margin: 25px 0 15px;
    }

    .main-content h3 {
        font-size: 18px;
        margin: 20px 0 12px;
    }

    .main-content p {
        font-size: 14px;
        text-align: left;
    }

    /* Sidebar */
    .sidebar .module {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    .sidebar .module h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .sidebar ul li {
        padding: 8px 0;
        font-size: 13px;
    }

    .sidebar .news-item {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }

    .sidebar .news-item h4 {
        font-size: 15px;
    }

    /* Services Section */
    .services-section {
        padding: 40px 0;
    }

    .services-section h2 {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .service-card img {
        height: 180px;
    }

    .service-card-content {
        padding: 20px;
    }

    .service-card h3 {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .service-card p {
        font-size: 13px;
    }

    /* Certificates */
    .certificates-section {
        padding: 40px 0;
    }

    .certificates-section h2 {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .certificates-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .certificate-item {
        padding: 15px;
    }

    .certificate-item img {
        max-height: 100px;
    }

    /* Footer */
    .footer-top {
        padding: 30px 0;
    }

    .site-footer {
        padding: 40px 0 15px;
    }

    .footer-col h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .footer-col a,
    .footer-col p {
        font-size: 13px;
    }

    .copyright {
        padding: 15px 0;
        font-size: 12px;
    }

    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 13px;
        width: 100%;
        text-align: center;
    }

    /* Forms */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }

    /* Back to Top */
    .back-to-top {
        width: 35px;
        height: 35px;
        line-height: 35px;
        bottom: 15px;
        right: 15px;
        font-size: 16px;
    }

    /* Tables */
    table {
        font-size: 12px;
    }

    table th,
    table td {
        padding: 8px;
    }
}

/* ========================================
   LANDSCAPE ORIENTATION - Mobile Devices
   ======================================== */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 60px 0 50px;
        min-height: 300px;
    }

    .hero-section h1 {
        font-size: 32px;
    }

    .main-navigation.active {
        max-height: 400px;
    }
}

/* ========================================
   VERY SMALL SCREENS - 360px and below
   ======================================== */
@media screen and (max-width: 360px) {
    .logo img {
        height: 30px;
    }

    .top-icons a {
        width: 26px;
        height: 26px;
    }

    .hero-section h1 {
        font-size: 24px;
    }

    .hero-section p {
        font-size: 13px;
    }

    .main-navigation > ul > li > a {
        padding: 12px 15px;
        font-size: 12px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .site-header,
    .main-navigation-wrapper,
    .mobile-toggle,
    .top-icons,
    .sidebar,
    .breadcrumbs-wrapper,
    .footer-top,
    .site-footer,
    .copyright,
    .back-to-top,
    .hero-dots {
        display: none !important;
    }

    .hero-section {
        padding: 30px 0;
        background: #f5f5f5 !important;
        color: #000 !important;
        min-height: auto;
    }

    .hero-section::before {
        display: none;
    }

    .hero-section h1,
    .hero-section p,
    .hero-section .subtitle {
        color: #000 !important;
        text-shadow: none !important;
    }

    .main-content {
        width: 100%;
        max-width: 100%;
    }

    .main-row {
        display: block;
    }

    body {
        font-size: 12pt;
        color: #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    img {
        max-width: 100%;
        page-break-inside: avoid;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        color: #000;
    }

    table {
        page-break-inside: avoid;
    }
}

/* ========================================
   ACCESSIBILITY & MOTION PREFERENCES
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-section::before {
        animation: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .main-navigation > ul > li > a {
        border: 1px solid rgba(255,255,255,0.3);
    }

    .service-card,
    .certificate-item,
    .sidebar .module {
        border: 2px solid #000;
    }
}

/* Dark mode preference (if you want to support it) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.main-navigation a:focus-visible {
    outline: 3px solid #0c5282;
    outline-offset: 2px;
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media screen and (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }

    .hide-tablet {
        display: none !important;
    }

    .show-tablet {
        display: block !important;
    }
}

@media screen and (max-width: 480px) {
    .hide-mobile-small {
        display: none !important;
    }

    .show-mobile-small {
        display: block !important;
    }
}
