/* -------------------------------------------------------------------------
   Wave 1 — Universal chrome & readability (stakeholder cleanup)
   ------------------------------------------------------------------------- */

/*
 * Page chrome: solid gray near the washed farm-photo tone so the white
 * content panel still "floats" left/right of main content.
 *
 * overflow-x: clip (not hidden) — body { overflow-x: hidden } from the theme
 * breaks position:sticky/fixed scroll behavior on iOS Safari.
 */
html {
    overflow-x: clip;
}

body.wide_layout,
.wrapper_container {
    background-color: #e8eef0;
    background-image: none;
    min-height: 100vh;
    overflow-x: clip;
}

body.wide_layout {
    overflow-x: clip !important; /* override rev-style.css body overflow-x: hidden */
}

/*
 * Logo band: #1 sea-cage aerial as background behind the ISAN logo.
 * Left edge of the logo pad must match .content > .container (white card).
 * BS3 columns add 15px gutters — zero those here so the logo is not inset
 * on desktop/landscape (mobile already looked aligned by coincidence).
 */
.header.header_4 .h_bot_part,
.header_4 .h_bot_part {
    /* Horizontal 15px matches .content so containers share the same stage */
    padding-top: 28px !important;
    padding-right: 15px !important;
    padding-bottom: 28px !important;
    padding-left: 15px !important;
    margin: 0 !important;
    text-align: left;
    background-color: #0b4f6c;
    background-image:
        linear-gradient(rgba(11, 79, 108, 0.35), rgba(11, 79, 108, 0.45)),
        url("../_images/site/hero-sea-cages.webp");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.header.header_4 .h_bot_part .container {
    text-align: left;
    /* Match outer edge of .content > .container (white card), not its text gutter */
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Cancel BS3 row negative margins + column gutters so logo sits on the
   container’s left edge (same as the white content card outer edge). */
.header.header_4 .h_bot_part .row {
    text-align: left;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.header.header_4 .h_bot_part [class*="col-"] {
    text-align: left;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    float: none;
    width: 100%;
}

.header.header_4 .logo {
    display: inline-block;
    float: none !important;
    margin: 0 !important;
    padding: 10px 20px !important;
    text-align: left;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.header.header_4 .logo img {
    display: block;
    max-height: 180px;
    width: auto;
    max-width: 100%;
    margin: 0;
    padding: 0;
    vertical-align: top;
}

/* Top utility strip removed from markup; keep hide rule if partial is restored */
.header.header_4 .h_top_part {
    display: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    border: none !important;
}

/* Menu sits just under logo band (sibling of header, not a child) */
.menu_wrap {
    margin-top: 0 !important;
    padding-top: 0;
    /* Theme used [class*="header_"] .menu_wrap — restore when nav is outside header */
    background: #383e44;
    overflow: visible;
}

/* Light label color was [class*="header_"] .main_menu > ul > li > a (#f2f2f2) */
.menu_wrap .main_menu > ul > li > a {
    color: #f2f2f2;
    margin-bottom: 0;
    border: none;
    padding: 15px 18px;
}

.menu_wrap .main_menu > ul > li:hover > a,
.menu_wrap .main_menu > ul > li.current > a,
.menu_wrap .main_menu > ul > li[class*="current_"] > a {
    background: #13b7ff;
    color: #fff;
    border: none;
}

/*
 * All viewports: black menu bar fixed at top of the page (same idea as mobile).
 * Logo/content sit below via wrapper padding so they are not covered.
 */
.wrapper_container {
    padding-top: calc(3.25rem + env(safe-area-inset-top, 0px));
}

.menu_wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    width: 100%;
    margin: 0 !important;
    padding-top: env(safe-area-inset-top, 0px);
    background: #383e44;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Desktop: keep horizontal dropdowns above page content */
@media only screen and (min-width: 992px) {
    .wrapper_container {
        /* Horizontal nav bar is a bit taller than the mobile Menu button */
        padding-top: calc(3.5rem + env(safe-area-inset-top, 0px));
    }

    .menu_wrap .sub_menu_wrap {
        z-index: 1101;
    }
}

/*
 * Mobile nav (Shopify-style): full-screen panel when Menu is open.
 * Top bar is already fixed for all viewports (rules above).
 */
@media only screen and (max-width: 991px) {
    .menu_wrap {
        text-align: left;
    }

    /* Kill BS3 .container centering so items span the full screen width */
    .menu_wrap > .container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        text-align: left;
    }

    .menu_wrap #menu_button {
        display: block;
        width: 100%;
        margin: 0;
        padding: 0.95rem 1rem;
        border: 0;
        background: #383e44;
        color: #fff;
        text-align: left !important;
        text-transform: uppercase;
        font-size: 1rem;
        line-height: 1.2;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.15);
    }

    .menu_wrap #menu_button.active {
        background: #2a3036;
    }

    /*
     * Full-screen takeover when open (class toggled by rmenu JS).
     * Override theme display:none / jQuery slide styles with !important.
     */
    .menu_wrap.isan-nav-open {
        bottom: 0;
        display: flex;
        flex-direction: column;
        height: 100%;
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
        text-align: left;
    }

    /* Flex the inner container so the link list can fill the screen */
    .menu_wrap.isan-nav-open > .container {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .menu_wrap .main_menu {
        display: none; /* closed; open state set via class + inline style from JS */
        float: none !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 0 env(safe-area-inset-bottom, 0px);
        background: #383e44;
        text-align: left !important;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .menu_wrap.isan-nav-open .main_menu {
        display: block !important;
        flex: 1 1 auto;
        min-height: 0;
    }

    .menu_wrap .main_menu > ul {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0.25rem 0 1.5rem;
        float: none !important;
        text-align: left !important;
        list-style: none;
    }

    .menu_wrap .main_menu > ul > li {
        display: block !important;
        float: none !important;
        width: 100% !important;
        text-align: left !important;
    }

    .menu_wrap .main_menu > ul > li > a {
        display: block !important;
        width: 100%;
        box-sizing: border-box;
        color: #f2f2f2;
        text-align: left !important;
        padding: 1rem 1.15rem !important;
        font-size: 1.05rem;
        pointer-events: auto;
    }

    .menu_wrap .sub_menu_wrap {
        position: static !important;
        float: none !important;
        width: 100% !important;
        background: #2a3036 !important;
        padding: 0 0 0 0.75rem !important;
        margin: 0 !important;
        text-align: left !important;
        -webkit-transform: none !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .menu_wrap .sub_menu_wrap a {
        display: block !important;
        width: 100%;
        box-sizing: border-box;
        color: #e8eef0;
        text-align: left !important;
        padding: 0.75rem 1.15rem;
    }

    /* Lock background page scroll while the full-screen menu is open */
    body.isan-nav-open {
        overflow: hidden !important;
    }
}

/* -------------------------------------------------------------------------
   Content: white panel floating over the solid gray page chrome
   ------------------------------------------------------------------------- */
.content {
    background: transparent !important;
    padding: 28px 15px 48px;
}

/* Solid content card — gray page chrome shows left/right */
.content > .container {
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 4px 28px rgba(11, 79, 108, 0.18);
    padding-top: 12px;
    padding-bottom: 36px;
    margin-bottom: 8px;
}

/* -------------------------------------------------------------------------
   Page titles: both green rules visible (was-styles only had a top border)
   ------------------------------------------------------------------------- */

.content .section_title {
    color: #0b4f6c;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.2em;
    border-top: 2px solid #2d9b83;
    border-bottom: 2px solid #2d9b83;
    border-left: none;
    border-right: none;
    padding-top: 12px;
    padding-bottom: 12px;
    margin-top: 18px;
    margin-bottom: 28px;
}

/* -------------------------------------------------------------------------
   Readability: air between paragraphs site-wide
   ------------------------------------------------------------------------- */
.content p {
    margin-bottom: 1.15em;
    line-height: 1.55;
}

.content p:last-child {
    margin-bottom: 0;
}

/* -------------------------------------------------------------------------
   Subheads: one consistent style (At a Glance, Specific Objectives, etc.)
   ------------------------------------------------------------------------- */
.content h4 {
    margin-top: 1.85em;
    margin-bottom: 0.85em;
    color: #0b4f6c;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 1.25em;
    line-height: 1.3;
    text-transform: none;
    border: none;
    padding: 0;
}

.content h4:first-of-type {
    margin-top: 0.5em;
}

.content h5 {
    margin-top: 1.35em;
    margin-bottom: 0.65em;
    color: #0b4f6c;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 1.1em;
    line-height: 1.3;
}

.isan-card {
    background: #f8f9fa;
    border-left: 4px solid #1b7a8c;
    padding: 20px 24px;
    margin-bottom: 24px;
}

/*
 * Footer: washed Norway salmon cages (same light wash as the prior
 * page backdrop; natural cover crop — not zoomed).
 * Path relative to Content/isan-custom.css → _images/site/
 */
.footer.footer-main {
    position: relative;
    z-index: 1;
    background-color: #e8eef0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.88), rgba(244, 247, 248, 0.92)),
        url("../_images/site/bg-salmon-cages.webp");
    background-size: auto, cover;
    background-position: center center, center center;
    background-repeat: no-repeat;
}

/* Let the photo show through the footer bands */
.footer.footer-main .footer_top_part,
.footer.footer-main .footer_bottom_part {
    background: transparent !important;
}

.isan-card h3 {
    margin-top: 0;
    color: #0b4f6c;
}

.membership-coming-soon {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 16px 20px;
    margin: 20px 0;
}

/* Membership inherits global h4; keep page class for future page-only tweaks */
.membership-page h4 {
    /* uses .content h4 */
}

/* Founding members: multi-column list for scannability */
.founding-members-list {
    columns: 2;
    -webkit-columns: 2;
    -moz-columns: 2;
    column-gap: 2em;
    margin-bottom: 1.5em;
    padding-left: 1.25em;
}

.founding-members-list li {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 0.35em;
}

@media (max-width: 767px) {
    .founding-members-list {
        columns: 1;
        -webkit-columns: 1;
        -moz-columns: 1;
    }
}

.membership-pdf-link,
a.membership-pdf-link.btn,
.doc-download-link,
a.doc-download-link.btn {
    display: inline-block;
    margin-top: 4px;
    background-color: #1b7a8c;
    border-color: #1b7a8c;
    color: #ffffff;
    text-decoration: none;
}

.membership-pdf-link:hover,
.membership-pdf-link:focus,
a.membership-pdf-link.btn:hover,
a.membership-pdf-link.btn:focus,
.doc-download-link:hover,
.doc-download-link:focus,
a.doc-download-link.btn:hover,
a.doc-download-link.btn:focus {
    background-color: #0b4f6c;
    border-color: #0b4f6c;
    color: #c5eef5;
    text-decoration: none;
}

.membership-pdf-note,
.doc-download-note {
    font-size: 0.95em;
    color: #555;
    margin-top: 8px;
}

.minutes-list li {
    margin-bottom: 1.5em;
}

/* Events sub-pages: clear separation for back navigation */
.events-back-link {
    margin-top: 2.25em;
    padding-top: 1.1em;
    border-top: 1px solid #d0e3e8;
}

/* Space before sponsorship contact line */
.sponsor-contact {
    margin-top: 1.5em;
}

.organization-list li {
    margin-bottom: 8px;
}

/* Board / officers — match global subhead scale */
.board-listing .board-role {
    margin-top: 0.75em;
    margin-bottom: 0.35em;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #0b4f6c;
    font-size: 0.9em;
}

.board-listing h4 {
    margin-top: 1.85em;
    margin-bottom: 0.85em;
    color: #0b4f6c;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 1.25em;
    line-height: 1.3;
}

.board-listing p {
    margin-bottom: 0.85em;
    line-height: 1.45;
}

.board-listing h5 {
    margin-top: 1.5em;
    margin-bottom: 0.85em;
    color: #0b4f6c;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 1.1em;
    line-height: 1.3;
    clear: both;
}

/*
 * Board photo cards
 * BS3 float columns size to content, so height:100% on the card never
 * equalized a row. Flex the grid so columns stretch to the tallest card
 * (e.g. wrapped names in Americas) and cards fill that height.
 */
.board-photo-grid {
    margin-left: -10px;
    margin-right: -10px;
    display: flex;
    flex-wrap: wrap;
}

.board-photo-grid > [class*="col-"] {
    padding-left: 10px;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
}

.board-member-card {
    background: #f8f9fa;
    border: 1px solid #e2e8ea;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
    flex: 1 1 auto;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.board-member-photo {
    display: block;
    width: 100%;
    max-width: 220px;
    height: 220px;
    object-fit: cover;
    object-position: center top;
    margin: 0 auto 8px;
    border-radius: 3px;
    background: #e8eef0;
    flex-shrink: 0;
}

.board-member-card-compact .board-member-photo {
    max-width: 160px;
    height: 160px;
}

.board-member-card .board-role {
    margin-top: 0.35em;
}

/*
 * Names stay under the photo (not pinned to the card foot). Extra height
 * from equalized rows shows as empty space below the text block.
 */
.board-member-card > p:last-child {
    margin-bottom: 0;
    align-self: stretch;
}

.board-group-photo-wrap {
    margin: 1em 0 1.75em;
    text-align: center;
}

.board-group-photo {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 4px;
    border: 1px solid #e2e8ea;
}

.board-group-caption {
    margin-top: 0.5em;
    font-size: 0.95em;
}

/* Schrama Prize winners */
.schrama-winners {
    margin-top: 0.5em;
}

.schrama-winner-card {
    background: #f8f9fa;
    border: 1px solid #e2e8ea;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 20px;
    text-align: center;
    height: calc(100% - 20px);
}

.schrama-winner-photo {
    display: block;
    width: 100%;
    max-width: 320px;
    height: 320px;
    object-fit: cover;
    object-position: center top;
    margin: 0 auto 10px;
    border-radius: 3px;
    background: #e8eef0;
}

.schrama-ceremony-wrap {
    margin: 0.5em 0 1.5em;
    text-align: center;
}

.schrama-ceremony-photo {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 4px;
    border: 1px solid #e2e8ea;
}

.schrama-ceremony-caption {
    margin-top: 0.5em;
    font-size: 0.95em;
}

/* Hybrid home: four principal entry banners */
.home-banners {
    margin-top: 28px;
}

a.home-banner-card {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

a.home-banner-card:hover,
a.home-banner-card:focus {
    color: inherit;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(11, 79, 108, 0.15);
    transform: translateY(-2px);
}

a.home-banner-card h3 {
    font-size: 1.15em;
}

a.home-banner-card h3 .fa {
    margin-right: 6px;
    color: #1b7a8c;
}

/* History page — archival and recent symposium photos */
.history-photo-wrap {
    margin: 1.25em 0 1.75em;
    text-align: center;
}

.history-photo {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 4px;
    border: 1px solid #e2e8ea;
    background: #f0f2f3;
}

.history-photo-caption {
    margin: 0.55em 0 0;
    font-size: 0.95em;
    line-height: 1.4;
    text-align: center;
}

/* Wide thin page banners (shared Membership + Events subpages) */
.content-banner-wrap {
    margin: 0 0 1.5em;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e2e8ea;
    background: #e8eef0;
    line-height: 0;
}

.content-banner {
    display: block;
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    object-position: center center;
}

/* Events index — featured meeting + Darwin photo strip */
.events-featured-meeting {
    margin: 1.5em 0 2em;
    padding: 1.25em 1.25em 1em;
    background: #f8f9fa;
    border: 1px solid #e2e8ea;
    border-radius: 4px;
    border-left: 4px solid #1b7a8c;
}

.events-featured-meeting > h4 {
    margin-top: 0;
    margin-bottom: 0.5em;
}

.events-featured-meta {
    margin-bottom: 1em;
}

.events-featured-cta {
    margin-bottom: 1.25em;
}

.events-featured-cta .btn {
    margin-top: 0;
}

.events-photo-grid {
    margin-left: -8px;
    margin-right: -8px;
}

.events-photo-grid > [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
}

.events-photo-card {
    margin: 0 0 1em;
    background: #fff;
    border: 1px solid #e2e8ea;
    border-radius: 4px;
    overflow: hidden;
    text-align: center;
}

.events-photo-card img {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center center;
    background: #e8eef0;
}

.events-photo-card figcaption {
    margin: 0;
    padding: 0.45em 0.6em 0.55em;
    font-size: 0.9em;
    line-height: 1.3;
}

.events-featured-note {
    margin-top: 0.5em;
    margin-bottom: 0.75em;
}

.events-featured-next {
    margin-bottom: 0;
    font-size: 0.95em;
}

/* Past ISFNF meetings — world map of venues */
.past-meetings-map-wrap {
    margin: 1em 0 1.75em;
    text-align: center;
}

.past-meetings-map {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 4px;
    border: 1px solid #e2e8ea;
    background: #f8f9fa;
}

.past-meetings-map-caption {
    margin-top: 0.5em;
    font-size: 0.95em;
}

/* Past ISFNF meetings table */
.past-meetings-wrap {
    margin: 20px 0 28px;
}

.past-meetings-table {
    font-size: 0.92em;
}

.past-meetings-table th {
    background: #0b4f6c;
    color: #fff;
    white-space: nowrap;
}

.past-meetings-table td:first-child {
    font-weight: 700;
    white-space: nowrap;
}

.past-meetings-abstract-link {
    display: inline-block;
    margin-top: 0.35em;
    font-size: 0.95em;
}

/* Footer contact links: vertically center FA icons with label text */
.footer .widget_newsletter .nav-list a {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    line-height: 1.4;
}

.footer .widget_newsletter .nav-list a .fa,
.footer .widget_newsletter .nav-list a .fab,
.footer .widget_newsletter .nav-list a .fas {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15em;
    line-height: 1;
    font-size: 1.05em;
    vertical-align: middle;
    margin: 0;
    position: relative;
    top: 0;
}
