/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #ffffff;
}
a {
    text-decoration: none;
}
/* Main Header */
.header {
    width: 100%;
    height: 100px;
    padding: 0 4.2%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #ffffff;
    margin-top: 15px;
}

/* Logo */
header .logo{
    display: flex;
    align-items: center;
}

.logo img {
    /* width: 210px; */
    height: 100px;
    object-fit: contain;
    object-position: left center;
    display: block;
}

/* Navigation */
.navigation {
    display: flex;
    align-items: center;
    gap: 58px;
}

.navigation a {
    text-decoration: none;
    color: #111111;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.navigation a:hover {
    color: #762c61;
}

/* Login and Signup */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn {
    height: 45px;
    padding: 0 23px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #000000;
    transition: all 0.2s ease;
}

.btn-login {
    background-color: #ffffff;
    color: #000000;
}

.btn-login:hover {
    background-color: #f2f2f2;
}

.btn-signup {
    background-color: #000000;
    color: #ffffff;
}

.btn-signup:hover {
    background-color: #702d60;
    border-color: #702d60;
}



/* =========================
   HERO SECTION
========================= */

.hero {
    min-height: 413px;
    padding: 35px 4.1% 20px;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 20px;
    background: #092970;
    color: #fff;
    overflow: hidden;
}

.hero-content {
    flex: 1 1 65%;
    min-width: 0;
    padding-top: 37px;
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    max-width: 780px;
    margin-bottom: 10px;
    font-size: 48px;
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -1px;
}

.hero-content h1 span {
    display: block;
    color: #f15b36;
    margin-top: 5px;
}

.search-box {
    width: 100%;
    max-width: 755px;
    margin-top: 10px;
    padding: 25px 14px 19px;
    border-radius: 12px;
    background: #272330;
    text-align: center;
}

.search-box p {
    margin-bottom: 21px;
    font-size: 17px;
    line-height: 1.5;
    color: #f5f5f5;
}

.course-search {
    display: flex;
    gap: 8px;
    padding: 0 20px;
}

.course-search input {
    flex: 1;
    min-width: 0;
    height: 51px;
    padding: 0 13px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
    font-family: inherit;
    font-size: 15px;
}

.course-search input:focus {
    border-color: #d7c16b;
}

.course-search button {
    padding: 0 30px;
    border: none;
    border-radius: 6px;
    background: #d7c16b;
    color: #000;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: 0.3s;
}

.course-search button:hover {
    background: #c5ac4c;
}

.search-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 35px;
    margin-top: 22px;
}

.search-links a {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

.search-links a:hover {
    color: #d7c16b;
}

.search-links span {
    color: #fff;
}


/* =========================
   HERO IMAGE
========================= */

.hero-image {
    width: 100%;
    max-width: 420px;
    height: 320px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.hero-image:hover img {
    transform: scale(1.04);
}

@media (max-width: 768px) {
    .hero-image {
        max-width: 100%;
        height: 260px;
    }
}

/* =========================
   LAPTOP WIDTH ADJUSTMENTS
========================= */

@media (max-width: 1200px) {
    .header {
        padding: 0 3%;
    }

    .logo img {
        width: 180px;
    }

    .navigation {
        gap: 30px;
    }

    .hero {
        padding-left: 3%;
        padding-right: 3%;
    }

    .hero-content h1 {
        font-size: 40px;
    }

    .search-box {
        padding-left: 10px;
        padding-right: 10px;
    }

    .course-search {
        padding: 0 8px;
    }

    .course-search button {
        padding: 0 18px;
    }

    .subjects {
        padding-left: 3%;
        padding-right: 3%;
    }

    .subject-card {
        padding: 14px;
        gap: 12px;
    }

    .subject-card span {
        font-size: 16px;
    }
}


/* =========================
   TABLET ADJUSTMENTS
========================= */

@media (max-width: 850px) {
    .header {
        height: auto;
        min-height: 85px;
        flex-wrap: wrap;
        gap: 20px;
        padding: 15px 4%;
    }

    .logo img {
        width: 160px;
        height: 50px;
    }

    .navigation {
        gap: 20px;
    }

    .auth-buttons {
        gap: 10px;
    }

    .hero {
        padding-top: 30px;
        min-height: auto;
    }

    .hero-content {
        padding-top: 20px;
    }

    .hero-content h1 {
        font-size: 34px;
    }

    .hero-image {
        flex-basis: 30%;
    }

    .course-search {
        flex-direction: column;
    }

    .course-search input,
    .course-search button {
        width: 100%;
        height: 48px;
    }

    .subject-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* =========================
   MOBILE ADJUSTMENTS
========================= */

@media (max-width: 560px) {
    .header {
        justify-content: center;
    }

    .navigation {
        width: 100%;
        justify-content: center;
        order: 3;
    }

    .auth-buttons {
        gap: 8px;
    }

    .hero {
        padding: 25px 5%;
        flex-direction: column;
    }

    .hero-content {
        padding-top: 0;
    }

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

    .search-box {
        padding: 20px 10px;
    }

    .search-box p {
        font-size: 15px;
    }

    .search-links {
        gap: 15px;
    }

    .search-links a {
        font-size: 13px;
    }

    .hero-image {
        display: none;
    }

    .subjects {
        padding: 40px 5%;
    }

    .subjects h2 {
        margin-bottom: 30px;
        font-size: 22px;
    }

    .subject-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .subject-card {
        min-height: 70px;
    }

    .view-subjects-btn {
        margin-top: 35px;
        font-size: 16px;
    }
}
/* =========================
   SUBJECTS SECTION
========================= */

.subjects {
    width: 100%;
    min-height: 440px;
    padding: 56px 4.1% 85px;
    margin-top: 25px;
    background: #dbc5c5;
    text-align: center;
}

.subjects h2 {
    margin-bottom: 28px;
    font-size: 25px;
    font-weight: 700;
}

.subjects h3 {
    margin-bottom: 20px;
}
.subject-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.subject-card {
    min-height: 80px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 17px;
    background: #fff;
    border-radius: 8px;
    color: #202033;
    text-align: left;
    transition: transform 0.25s, box-shadow 0.25s;
}

.subject-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.subject-card i {
    flex-shrink: 0;
    width: 30px;
    font-size: 25px;
    color: #080808;
    text-align: center;
}

.subject-card span {
    font-size: 18px;
    line-height: 1.25;
    font-weight: 500;
}

.view-subjects-btn {
    display: inline-block;
    margin-top: 55px;
    padding: 16px 28px;
    border-radius: 5px;
    background: #ad4d9a;
    color: #fff;
    font-size: 19px;
    font-weight: 700;
    transition: background 0.3s;
}

.view-subjects-btn:hover {
    background: #842f72;
}


/* =========================
   LAPTOP WIDTH ADJUSTMENTS
========================= */

@media (max-width: 1200px) {
    .header {
        padding: 0 3%;
    }

    .logo img {
        width: 180px;
    }

    .navigation {
        gap: 30px;
    }

    .hero {
        padding-left: 3%;
        padding-right: 3%;
    }

    .hero-content h1 {
        font-size: 40px;
    }

    .search-box {
        padding-left: 10px;
        padding-right: 10px;
    }

    .course-search {
        padding: 0 8px;
    }

    .course-search button {
        padding: 0 18px;
    }

    .subjects {
        padding-left: 3%;
        padding-right: 3%;
    }

    .subject-card {
        padding: 14px;
        gap: 12px;
    }

    .subject-card span {
        font-size: 16px;
    }
}

/* =====================================
   FEATURED ISO TRAINING COURSES
===================================== */

.featured-courses {
    width: 100%;
    padding: 65px 0 60px;
    background: #f7f8fb;
    font-family: Arial, Helvetica, sans-serif;
    color: #14213d;
}

.courses-container {
    width: 84%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Section heading */

.courses-heading {
    margin-bottom: 38px;
}

.section-label {
    display: inline-block;
    margin-bottom: 10px;
    color: #e9573f;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
}

.courses-heading h2 {
    margin: 0 0 14px;
    color: #102c6c;
    font-size: 30px;
    font-weight: 750;
    line-height: 1.3;
}

.courses-heading p {
    max-width: 680px;
    margin: 0;
    color: #626b7b;
    font-size: 15px;
    line-height: 1.8;
}

/* Course grid */

.courses-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

/* Course card */

.course-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    background: #ffffff;
    border: 1px solid #dce1ea;
    border-radius: 11px;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.course-card:hover {
    transform: translateY(-5px);
    border-color: #b9c8e5;
    box-shadow: 0 12px 28px rgba(16, 44, 108, 0.10);
}

/* Image */

.course-image {
    position: relative;
    width: 100%;
    height: 165px;
    overflow: hidden;
    background: #e5eaf3;
}

.course-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;

    transition: transform 0.4s ease;
}

.course-card:hover .course-image img {
    transform: scale(1.05);
}

/* Category badge */

.course-category {
    position: absolute;
    left: 12px;
    bottom: 12px;

    padding: 6px 9px;
    border-radius: 4px;

    background: #102c6c;
    color: #ffffff;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Card content */

.course-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 17px 14px 16px;
}

.course-code {
    margin-bottom: 8px;
    color: #b04c91;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.course-content h3 {
    margin: 0 0 12px;
    color: #17213a;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
}

.course-description {
    margin: 0 0 18px;
    color: #646b78;
    font-size: 13px;
    line-height: 1.7;
}

/* Course details */

.course-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.course-meta span {
    color: #666c78;
    font-size: 12px;
    line-height: 1.5;
}

/* Price and link */

.course-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #edf0f5;
}

.course-price {
    color: #102c6c;
    font-size: 20px;
    font-weight: 800;
}

.course-link {
    color: #b04c91;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.course-link:hover {
    color: #102c6c;
    text-decoration: underline;
}

/* View all courses button */

.all-courses-action {
    display: flex;
    justify-content: center;
    margin-top: 38px;
}

.all-courses-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    padding: 14px 23px;
    border: 1px solid #b04c91;
    border-radius: 5px;

    color: #b04c91;
    background: #ffffff;

    font-size: 14px;
    font-weight: 700;
    text-decoration: none;

    transition: background 0.25s ease, color 0.25s ease;
}


[hidden] {
    display: none !important;
}

.all-courses-button {
    cursor: pointer;
    font: inherit;
}

.all-courses-button:hover {
    background: #b04c91;
    color: #ffffff;
}

/* Disclaimer */

.course-note {
    margin: 20px 0 0;
    color: #737987;
    font-size: 11px;
    line-height: 1.7;
    text-align: center;
}



/* =====================================
   LEARNER STORIES SECTION
===================================== */

.learner-stories {
    width: 100%;
    min-height: 460px;
    padding: 32px 6% 75px;
    background: #fdfbf5;
    color: #201d2b;
    border-top: 5px solid #e7e4dc;
    box-shadow: 0 -3px 6px rgba(0, 0, 0, 0.06);
}

.learner-stories > h2 {
    margin-bottom: 55px;
    text-align: center;
    font-size: 26px;
    font-weight: 800;
}

.testimonials {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 42px;
}

.testimonial-card {
    position: relative;
    min-width: 0;
    min-height: 233px;
    display: flex;
    flex-direction: column;
    border: 1px solid #aaa8ad;
    border-radius: 15px 15px 15px 15px;
    background: linear-gradient(#fff, #fafafa);
}

/* Speech-bubble tail */

.testimonial-card::after {
    content: "";
    position: absolute;
    right: 23%;
    bottom: -21px;
    width: 28px;
    height: 28px;
    background: #fafafa;
    border-right: 1px solid #aaa8ad;
    border-bottom: 1px solid #aaa8ad;
    transform: skew(0deg, 0deg) rotate(45deg);
    z-index: 0;
}

.testimonial-header {
    min-height: 82px;
    padding: 13px 14px;
    display: flex;
    align-items: center;
    gap: 13px;
    border-bottom: 1px solid #dedde0;
}

.learner-avatar {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e64a2c;
    border-radius: 50%;
    background: #29292b;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
}

.learner-info {
    min-width: 0;
    flex: 1;
}

.learner-info h3 {
    margin-bottom: 5px;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.learner-info span {
    color: #55525a;
    font-size: 11px;
}

.quote-icon {
    align-self: center;
    flex-shrink: 0;
    color: #e54829;
    font-family: Georgia, serif;
    font-size: 68px;
    font-weight: 700;
    line-height: 0.7;
    letter-spacing: -8px;
    padding-right: 8px;
}

.testimonial-body {
    flex: 1;
    padding: 10px 14px 14px;
    display: flex;
    flex-direction: column;
}

.testimonial-body p {
    color: #28252e;
    font-size: 13px;
    line-height: 1.8;
}

.testimonial-stars {
    margin-top: auto;
    padding-top: 17px;
    color: #f29b12;
    font-size: 22px;
    letter-spacing: 1px;
}


/* ==============================
   FAQ SECTION
============================== */

.faq-section {
    width: 83%;
    max-width: 1120px;
    margin: 35px auto 70px;
    color: #171522;
    font-family: Arial, Helvetica, sans-serif;
}

/* Main heading */

.faq-heading {
    font-size: 26px;
    font-weight: 750;
    line-height: 1.4;
    margin-bottom: 39px;
    color: #171522;
}

/* FAQ container */

.faq-container {
    width: 100%;
    border-top: 1px solid #201d29;
}

/* Individual FAQ item */

.faq-item {
    width: 100%;
    border-bottom: 2px solid #201d29;
}

/* Clickable question row */

.faq-question {
    width: 100%;
    min-height: 72px;
    padding: 20px 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;

    background: transparent;
    border: none;
    color: #171522;

    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    text-align: left;

    cursor: pointer;
}

/* Purple question text when expanded */

.faq-item.active .faq-question {
    color: #684080;
}

/* Plus and minus icons */

.faq-icon {
    min-width: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 25px;
    font-weight: 400;
    line-height: 1;
    color: #171522;
}

.faq-item.active .faq-icon {
    color: #684080;
}

/* Answer area */

.faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}

.faq-answer p {
    min-height: 0;
    overflow: hidden;

    padding: 0 30px;
    margin: 0;

    font-size: 15px;
    line-height: 1.9;
    color: #111;
}

/* Expanded answer */

.faq-item.active .faq-answer {
    grid-template-rows: 1fr;
}

.faq-item.active .faq-answer p {
    padding-top: 10px;
    padding-bottom: 31px;
}

.faq-answer strong {
    font-weight: 700;
}

/* Hover effect */

.faq-question:hover {
    color: #684080;
}

/* Keyboard accessibility */

.faq-question:focus-visible {
    outline: 2px solid #ad4d9a;
    outline-offset: -3px;
}

/* View All FAQs button */

.faq-view-all {
    display: flex;
    justify-content: center;
    margin-top: 9px;
    padding-bottom: 5px;
}

.faq-view-all a {
    display: inline-block;
    padding: 10px 13px;
    border: 1px solid #292633;
    color: #684080;
    background: #fff;
    font-size: 13px;
    text-decoration: underline;
    transition: all 0.25s ease;
}

.faq-view-all a:hover {
    background: #684080;
    color: #fff;
    border-color: #684080;
}



/* ===== Footer ===== */

.site-footer {
    background: #092970;
    color: #ffffff;
    font-family: Arial, sans-serif;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 55px 25px 45px;
    display: grid;
    grid-template-columns: 1.3fr 0.7fr 1.2fr;
    gap: 50px;
}

/* Footer sections */

.footer-section h3 {
    font-size: 20px;
    margin: 0 0 22px;
    color: #ffffff;
    position: relative;
}

.footer-section h3::after {
    content: "";
    display: block;
    width: 42px;
    height: 3px;
    background: #e9573f;
    margin-top: 10px;
    border-radius: 3px;
}

.footer-section p {
    color: #d6def0;
    font-size: 14px;
    line-height: 1.9;
    margin: 18px 0;
}

/* Logo and school description */

.footer-logo {
    display: inline-block;
    margin-bottom: 8px;
}

.footer-logo img {
    display: block;
    width: 180px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Quick access links */

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

.footer-links li {
    margin-bottom: 13px;
}

.footer-links a {
    color: #d6def0;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-links a:hover {
    color: #ff8a70;
    padding-left: 5px;
}

/* Newsletter */

.newsletter-form {
    display: flex;
    width: 100%;
    margin-top: 20px;
    gap: 8px;
}

.newsletter-form input {
    flex: 1;
    min-width: 0;
    padding: 13px 12px;
    border: 1px solid #dce3f1;
    border-radius: 5px;
    outline: none;
    font-size: 13px;
}

.newsletter-form input:focus {
    border-color: #e9573f;
    box-shadow: 0 0 0 2px rgba(233, 87, 63, 0.2);
}

.newsletter-form button {
    padding: 13px 16px;
    background: #e9573f;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.newsletter-form button:hover {
    background: #cf422c;
}

.newsletter-message {
    font-size: 13px !important;
    color: #ffffff !important;
    margin-top: 10px !important;
}

.footer-newsletter h4 {
    font-size: 16px;
    margin: 28px 0 15px;
    color: #ffffff;
}

/* Social links */

.footer-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-socials a {
    display: inline-block;
    padding: 9px 12px;
    color: #ffffff;
    text-decoration: none;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.footer-socials a:hover {
    background: #e9573f;
    border-color: #e9573f;
}

/* Accessibility helper */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Copyright section */

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
    padding: 18px 20px;
}

.footer-bottom p {
    color: #c4cfe5;
    font-size: 13px;
    margin: 0;
    line-height: 1.7;
}

/* Tablet */

@media (max-width: 900px) {
    .footer-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 40px;
    }

    .footer-newsletter {
        grid-column: 1 / -1;
    }
}

/* Mobile */

@media (max-width: 600px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 35px;
        padding: 40px 22px;
    }

    .footer-newsletter {
        grid-column: auto;
    }

    .footer-logo img {
        width: 160px;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
        box-sizing: border-box;
        padding: 14px;
    }

    .footer-bottom {
        padding: 18px 15px;
    }
}




/* =====================================================================
   RESPONSIVE ENHANCEMENTS
   Added at the END of the file so every original rule above is kept
   exactly as written. Nothing here applies above 1500px except the
   ultra-wide block, and screens between 1201px and 1499px render
   exactly as before.

   Why some earlier media queries did not work: the "Tablet" and
   "Mobile" blocks higher up for .subjects, .subject-grid, .subject-card
   and .view-subjects-btn come BEFORE those elements' main rules, so the
   main rules overrode them. They are repeated below, after the main
   rules, with the same values you wrote.
===================================================================== */

/* ---------- Safe defaults ---------- */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

img {
    max-width: 100%;
}

.subject-card span,
.course-content h3,
.course-meta span {
    overflow-wrap: break-word;
}

.course-category {
    max-width: calc(100% - 24px);
}


/* ---------- Very large screens (1500px and up) ----------
   Keeps the header, hero and sections from stretching edge to edge.
   Backgrounds stay full width; only the content is held to about 1400px. */

@media (min-width: 1500px) {
    .header {
        padding-left: max(4.2%, calc((100% - 1400px) / 2));
        padding-right: max(4.2%, calc((100% - 1400px) / 2));
    }

    .hero,
    .subjects {
        padding-left: max(4.1%, calc((100% - 1400px) / 2));
        padding-right: max(4.1%, calc((100% - 1400px) / 2));
    }

    .learner-stories {
        padding-left: max(6%, calc((100% - 1400px) / 2));
        padding-right: max(6%, calc((100% - 1400px) / 2));
    }
}


/* ---------- Small laptops and large tablets (up to 1100px) ---------- */

@media (max-width: 1100px) {
    .courses-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}


/* ---------- Tablets (up to 1000px) ---------- */

@media (max-width: 1000px) {
    .search-links {
        flex-wrap: wrap;
        row-gap: 10px;
    }
}


/* ---------- Tablets in portrait (up to 900px) ---------- */

@media (max-width: 900px) {
    .testimonials {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 46px 28px;
    }
}


/* ---------- Subjects: tablet (rule-order fix, same values as before) ---------- */

@media (max-width: 850px) {
    .subject-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* ---------- Courses: two columns (up to 800px) ---------- */

@media (max-width: 800px) {
    .courses-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* ---------- Header: tidy wrapping on large phones (up to 680px) ----------
   Uses the same arrangement you already had for 560px and below. */

@media (max-width: 680px) {
    .header {
        justify-content: center;
    }

    .navigation {
        width: 100%;
        justify-content: center;
        order: 3;
    }

    .testimonials {
        grid-template-columns: 1fr;
    }
}


/* ---------- Phones (up to 560px) ---------- */

@media (max-width: 560px) {

    /* Subjects: rule-order fix, same values as before */
    .subjects {
        padding: 40px 5%;
    }

    .subjects h2 {
        margin-bottom: 30px;
        font-size: 22px;
    }

    .subject-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .subject-card {
        min-height: 70px;
    }

    .view-subjects-btn {
        margin-top: 35px;
        font-size: 16px;
    }

    /* Navigation: easier to tap */
    .navigation a {
        padding: 8px 2px;
    }

    /* Featured courses */
    .featured-courses {
        padding: 45px 0 45px;
    }

    .courses-container {
        width: 90%;
    }

    .courses-heading {
        margin-bottom: 28px;
    }

    .courses-heading h2 {
        font-size: 24px;
    }

    .courses-heading p {
        font-size: 14px;
    }

    .all-courses-action {
        margin-top: 30px;
    }

    /* Learner stories */
    .learner-stories {
        padding: 28px 5% 60px;
    }

    .learner-stories > h2 {
        margin-bottom: 40px;
        font-size: 22px;
    }

    /* FAQ */
    .faq-section {
        width: 90%;
        margin: 25px auto 50px;
    }

    .faq-heading {
        margin-bottom: 25px;
        font-size: 22px;
    }

    .faq-question {
        min-height: 64px;
        padding: 16px 4px;
        gap: 15px;
        font-size: 16px;
    }

    .faq-answer p {
        padding-left: 8px;
        padding-right: 8px;
        font-size: 14px;
        line-height: 1.8;
    }
}


/* ---------- Courses: one column (up to 520px) ---------- */

@media (max-width: 520px) {
    .courses-grid {
        grid-template-columns: 1fr;
    }
}


/* ---------- Small phones (up to 420px) ---------- */

@media (max-width: 420px) {
    .navigation {
        gap: 22px;
    }

    .btn {
        padding: 0 18px;
    }

    .hero-content h1 {
        font-size: 28px;
    }

    .search-box p {
        font-size: 14px;
    }

    .search-links {
        flex-direction: column;
        gap: 10px;
    }

    .search-links span {
        display: none;
    }

    .subject-card span {
        font-size: 15px;
    }

    .view-subjects-btn {
        padding: 14px 22px;
    }

    .testimonial-body p {
        font-size: 14px;
    }
}


/* ---------- Very small phones (up to 340px) ---------- */

@media (max-width: 340px) {
    .hero-content h1 {
        font-size: 25px;
    }

    .logo img {
        width: 140px;
    }

    .courses-heading h2 {
        font-size: 22px;
    }
}


/* ---------- Touch screens: no "stuck" hover movement ---------- */

@media (hover: none) {
    .subject-card:hover,
    .course-card:hover {
        transform: none;
    }

    .hero-image:hover img,
    .course-card:hover .course-image img {
        transform: none;
    }
}


/* ---------- Respect "reduce motion" device settings ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* =====================================================================
   COURSES DROPDOWN (header menu)
   Added at the end so no existing rule is changed.
===================================================================== */

.nav-dropdown {
    position: relative;
}

/* The "Courses" link keeps the same look as the other menu links.
   The extra padding makes the hover area reach the menu with no gap. */
.navigation .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 0;
}

/* Small arrow after the word "Courses" */
.navigation .dropdown-toggle::after {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

.nav-dropdown.open .dropdown-toggle::after {
    transform: rotate(-135deg) translateY(-2px);
}

.nav-dropdown.open .dropdown-toggle {
    color: #762c61;
}

/* The menu box */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: -18px;
    z-index: 1000;
    min-width: 370px;
    padding: 8px 0;
    list-style: none;
    background: #ffffff;
    border: 1px solid #e3e6ee;
    border-radius: 8px;
    box-shadow: 0 14px 30px rgba(16, 44, 108, 0.16);

    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    /* Fades out first, then becomes hidden */
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.nav-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
}

/* Mouse users: open on hover */
@media (hover: hover) {
    .nav-dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
    }

    .nav-dropdown:hover .dropdown-toggle {
        color: #762c61;
    }

    .nav-dropdown:hover .dropdown-toggle::after {
        transform: rotate(-135deg) translateY(-2px);
    }
}

.dropdown-menu li {
    list-style: none;
}

.navigation .dropdown-menu a {
    display: block;
    padding: 11px 22px;
    font-size: 15px;
    line-height: 1.35;
    white-space: normal;
}

.navigation .dropdown-menu a:hover,
.navigation .dropdown-menu a:focus-visible {
    background: #f6eff4;
    color: #762c61;
}

.navigation .dropdown-toggle:focus-visible,
.navigation .dropdown-menu a:focus-visible {
    outline: 2px solid #ad4d9a;
    outline-offset: -2px;
}

/* Phones and small tablets: the menu spans the width of the header
   instead of hanging under the word "Courses". */
@media (max-width: 680px) {
    .navigation {
        position: relative;
    }

    .nav-dropdown {
        position: static;
    }

    .dropdown-menu {
        left: 0;
        right: 0;
        min-width: 0;
        top: calc(100% + 2px);
    }

    .navigation .dropdown-menu a {
        padding: 13px 20px;
        font-size: 16px;
    }
}