/* ==========================================================================
   IAWS - Responsive styles for the new layout work
   Plain CSS only. Main styles are in style.css.
   Breakpoints follow Bootstrap 5: 1234px (desktop menu hides), 991px, 767px, 575px
   ========================================================================== */


/* ==========================================================================
   Below 1235px: mobile / tablet menu
   The desktop menu is shown only from 1235px (old site CSS), so the mobile
   menu is shown on every smaller screen. These rules are the same as the old
   phone-only (767px) menu rules in header.php, extended up to 1234px.
   ========================================================================== */
@media (max-width: 1234px) {
    /* position: relative so the open menu panel sits right below the logo bar */
    .header-mobile {
        position: relative;
        display: block;
        width: 100%;
    }

    .Header_smallScreen__2HJAI {
        display: none;
    }

    .header-mobile img {
        height: 50px;
    }

    /* static: Bootstrap makes .navbar relative, which squeezed the panel into the container */
    .header-mobile .navbar {
        position: static;
        width: 100%;
    }

    .Header_logoNHam__1Rmpj {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }

    button.navbar-toggler {
        position: absolute;
        right: 0;
        top: 12px;
    }

    .navbar-light .navbar-toggler {
        color: rgba(0, 0, 0, .55);
        border-color: transparent !important;
    }

    .navbar-light .navbar-toggler-icon {
        background-image: url("../images/hamburger-open.svg");
    }

    .navigation_caret__2xYy_ img {
        display: none;
    }

    /* ---------- Mobile menu panel ----------
       Full width below the logo bar, scrolls inside itself when it is long.
       Selectors start with .header-mobile #navbarNavAltMarkup ... so they win
       over the old phone-menu rules that are still inside header.php. */
    .header-mobile #navbarNavAltMarkup {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1000;
        width: auto;
        height: auto;
        max-height: calc(100vh - 130px);
        overflow-y: auto;
        background: #48727a;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    }

    .header-mobile #navbarNavAltMarkup ul.navbar-nav {
        margin: 0;
        padding: 6px 0;
    }

    .header-mobile #navbarNavAltMarkup ul.navbar-nav li {
        position: relative;
        padding: 0;
        list-style: none;
    }

    /* top-level items: one row each, with a thin divider */
    .header-mobile #navbarNavAltMarkup ul.navbar-nav > li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .header-mobile #navbarNavAltMarkup ul.navbar-nav > li:last-child {
        border-bottom: 0;
    }

    .header-mobile #navbarNavAltMarkup ul.navbar-nav a {
        display: block;
        padding: 13px 60px 13px 20px;
        color: #fff;
        font-size: 17px;
        font-weight: 600;
        line-height: 1.4;
        text-decoration: none;
    }

    /* !important: the old site CSS sets .bold-1 to 23px !important */
    .header-mobile #navbarNavAltMarkup .bold-1 {
        font-size: 17px !important;
        font-weight: 600;
    }

    .header-mobile #navbarNavAltMarkup ul.navbar-nav a:hover,
    .header-mobile #navbarNavAltMarkup ul.navbar-nav li.submenu-open > a {
        color: #fdbba1;
    }

    /* sub-menus: closed until the arrow is tapped (arrows are added by the script in header.php) */
    .header-mobile #navbarNavAltMarkup ul.navbar-nav li > ul {
        display: none;
        margin: 0;
        padding: 0 0 8px;
        background: rgba(0, 0, 0, 0.12);
    }

    .header-mobile #navbarNavAltMarkup ul.navbar-nav li.submenu-open > ul {
        display: block;
    }

    .header-mobile #navbarNavAltMarkup ul.navbar-nav li li > a {
        padding: 10px 60px 10px 36px;
        font-size: 15px;
        font-weight: 400;
    }

    /* third level (e.g. Regional Conferences > Northern) */
    .header-mobile #navbarNavAltMarkup ul.navbar-nav li li li > a {
        padding-left: 52px;
        font-size: 14px;
    }

    .header-mobile #navbarNavAltMarkup .submenu-toggle {
        position: absolute;
        top: 6px;
        right: 12px;
        width: 36px;
        height: 36px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
        font-size: 16px;
        line-height: 36px;
        transition: transform 0.2s ease;
    }

    .header-mobile #navbarNavAltMarkup li li > .submenu-toggle {
        top: 3px;
        width: 32px;
        height: 32px;
        line-height: 32px;
    }

    .header-mobile #navbarNavAltMarkup li.submenu-open > .submenu-toggle {
        transform: rotate(180deg);
    }

    .header-mobile #navbarNavAltMarkup .submenu-toggle:focus-visible {
        outline: 2px solid #fdbba1;
        outline-offset: 2px;
    }
}


/* ==========================================================================
   Below 992px: tablets
   ========================================================================== */
@media (max-width: 991px) {
    /* Homepage slider + notice board (notice board moves below the slider) */
    .home-slider .carousel-item img {
        height: 320px;
    }

    .notice-board {
        height: 350px;
    }

    /* Homepage cards: photo above the text */
    .home-card-image img {
        height: 300px;
        min-height: 0;
    }

    .home-card-body {
        padding: 30px 25px;
    }

    /* Page title banner */
    .page-banner {
        margin-bottom: 40px;
        padding: 50px 0;
    }

    /* Milestones: 3 member cards per row */
    .milestone-page .milestone-members {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* FCRA details: one item per line */
    .fcra-page .fcra-details {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    /* Document cards and seminar cards: 2 per row */
    .doc-grid,
    .seminars-page .seminar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-banner h1 {
        font-size: 32px !important;
    }

    /* Homepage 18th Conference box: title above the text */
    .home-conference {
        padding: 50px 0;
    }

    .home-conference-box {
        padding: 40px 30px;
    }

    .home-conference-title {
        margin-bottom: 25px;
    }

    .home-conference-text {
        padding-left: calc(var(--bs-gutter-x) * 0.5);
        border-left: 0;
    }

    /* About Us: image above the text, fixed height so it does not get too tall */
    .info-page .info-image-fill img {
        height: 380px;
        min-height: 0;
    }

    /* 18th National Conference page: poster above the details */
    .nc18-poster {
        margin-bottom: 30px;
    }
}


/* ==========================================================================
   Below 768px: phones
   ========================================================================== */
@media (max-width: 767px) {
    /* Homepage membership banner */
    .home-membership {
        padding: 60px 0;
    }

    .home-membership h2 {
        font-size: 34px !important;
    }

    /* Publications page: justified text leaves big gaps on narrow screens */
    .publications-page .pub-intro p,
    .publications-page .pub-item p {
        text-align: left;
    }

    .publications-page .pub-item h5 {
        font-size: 16px !important;
    }

    /* Common accordion (Newsletters, Publications, Milestones) */
    .site-accordion .accordion-button {
        padding: 14px 12px;
        font-size: 15px;
    }

    .site-accordion .accordion-body {
        padding: 12px;
    }

    /* Milestones: 2 member cards per row */
    .milestone-page .milestone-members {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .milestone-page .milestone-member {
        padding: 10px 12px;
    }

    .milestone-page .milestone-member h3 {
        font-size: 14px !important;
    }

    .milestone-page .milestone-member p {
        font-size: 13px;
    }

    /* Document card pages (Tributes, Archives, NR Doc Project Reports) */
    .doc-page {
        padding-bottom: 50px;
    }

    .doc-page .doc-page-intro {
        padding: 20px;
    }

    /* Past National Conferences: previous / next links one below the other */
    .conf-page .conf-nav {
        flex-direction: column;
    }

    /* Contact Us: less padding, shorter map */
    .contact-page {
        padding-bottom: 50px;
    }

    .contact-page .contact-card,
    .contact-page .contact-form-card {
        padding: 20px;
    }

    .contact-page .contact-map {
        margin-top: 35px;
    }

    .contact-page .contact-map iframe {
        height: 300px;
    }

    /* Membership form: less padding in the boxes */
    .membership-form-page {
        padding-bottom: 50px;
    }

    .membership-form-page .mf-section,
    .membership-form-page .mf-payment {
        padding: 18px;
    }

    .membership-form-page .mf-bank th,
    .membership-form-page .mf-bank td {
        display: block;
        width: 100%;
        padding: 6px 12px;
    }

    .membership-form-page .mf-bank th {
        padding-bottom: 0;
        border-bottom: 0;
    }

    /* Photo carousel: shorter photos, arrows centred on them */
    .conf-page .conf-gallery .owl-item img {
        height: 220px;
    }

    .conf-page .conf-gallery .owl-nav button.owl-prev,
    .conf-page .conf-gallery .owl-nav button.owl-next {
        top: 110px;
        width: 36px;
        height: 36px;
        font-size: 26px;
        line-height: 32px;
    }

    /* Document cards and seminar cards: 1 per row */
    .doc-grid,
    .seminars-page .seminar-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .seminars-page {
        padding-bottom: 50px;
    }

    /* Text + image pages (Evolution, Election) */
    .info-page {
        padding-bottom: 50px;
    }

    .info-page .info-text h2 {
        font-size: 24px !important;
    }

    .info-page .info-text h3 {
        font-size: 18px !important;
    }

    .info-page .info-text p {
        font-size: 15px;
        line-height: 1.7;
        text-align: left;
    }

    .info-page .info-text .info-lead {
        font-size: 16px;
    }

    /* About Us: text stays justified on phones too (asked by the client) */
    .about-page.info-page .info-text p {
        text-align: justify;
    }

    .info-page .info-text li {
        font-size: 15px;
    }

    .doc-grid .doc-card {
        padding: 16px;
    }
}


/* ==========================================================================
   Below 576px: small phones
   ========================================================================== */
@media (max-width: 575px) {
    .home-slider .carousel-item img {
        height: 220px;
    }

    /* Page title banner */
    .page-banner {
        margin-bottom: 30px;
        padding: 40px 0;
    }

    .page-banner h1 {
        font-size: 26px !important;
    }

    .page-banner .page-banner-subtitle {
        font-size: 16px;
    }

    /* About Us images */
    .info-page .info-image-fill img {
        height: 260px;
    }

    /* FCRA table: each receipt becomes a small card (labels come from data-label) */
    .fcra-page .fcra-details {
        padding: 20px;
    }

    .fcra-page .fcra-heading {
        font-size: 20px !important;
    }

    .fcra-page .fcra-table-wrap {
        overflow: visible;
        border: 0;
    }

    .fcra-page .fcra-table thead {
        display: none;
    }

    .fcra-page .fcra-table,
    .fcra-page .fcra-table tbody,
    .fcra-page .fcra-table tr,
    .fcra-page .fcra-table td {
        display: block;
        width: 100%;
    }

    .fcra-page .fcra-table tr {
        margin-bottom: 12px;
        padding: 6px 0;
        border: 1px solid #e3e3e3;
        border-radius: 12px;
        background: #fff;
    }

    .fcra-page .fcra-table tbody tr:nth-child(even) {
        background: #fff;
    }

    .fcra-page .fcra-table td,
    .fcra-page .fcra-table td:first-child {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        width: 100%;
        padding: 8px 16px;
        border-top: 0;
        text-align: right;
        white-space: normal;
    }

    .fcra-page .fcra-table td:before {
        content: attr(data-label);
        color: #4e2463;
        font-weight: 700;
        text-align: left;
        white-space: nowrap;
    }

    /* Homepage 18th Conference box */
    .home-conference {
        padding: 40px 0;
    }

    .home-conference-box {
        padding: 30px 20px;
    }

    .home-conference h2 {
        font-size: 28px !important;
    }

    .home-conference-text p {
        font-size: 16px;
        line-height: 1.7;
    }

    /* Homepage cards */
    .home-cards {
        padding: 40px 0;
    }

    .home-card-image img {
        height: 220px;
    }

    .home-card + .home-card {
        margin-top: 25px;
    }

    /* EC Members pages: 2 small cards per row */
    .ec-team {
        padding: 35px 0 50px;
    }

    .ec-team .ec-team-subheading {
        margin-bottom: 20px !important;
        font-size: 21px !important;
    }

    .ec-team .row + .ec-team-subheading {
        margin-top: 40px !important;
    }

    .ec-team-info {
        padding: 30px 8px 10px;
    }

    .ec-team-info h2 {
        font-size: 15px !important;
    }

    /* !important: the old site CSS sets a larger p size on phones */
    .ec-team-info .ec-team-role {
        font-size: 12px !important;
    }

    .ec-team-info .ec-team-email {
        font-size: 10px;
    }
}
