/* ss_sec3.css - the additions Sec3.html makes on top of ss_index.css.
 *
 * Loaded after ss_index.css. ss_index.css and ss_top.css both define
 * .container / .header / .notice / .content / .footer, so they cannot be
 * loaded together; the text navigation is copied in here instead. Keep it in
 * step with the bar in ss_top.css.
 *
 * Sec1, Sec2, Sec5 and /intermagnet/index.html (and their -j pages) also
 * load this file for the navigation, with ss_sec.css for their link lists.
 */

/* ---- text navigation (copied from ss_top.css) ---- */
.top-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    margin: 0 20px 25px;
    background: linear-gradient(180deg, #33526b 0%, #24405a 100%);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.18);
}

.top-nav ul {
    flex: 1 1 auto;
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

.top-nav li {
    flex: 1 1 auto;
    text-align: center;
}

.top-nav li + li {
    border-left: 1px solid rgba(255,255,255,0.14);
}

.top-nav a {
    display: block;
    padding: 13px 18px;
    color: #eaf2f8;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.top-nav a:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
}

.top-nav a[aria-current="page"] {
    background: #3498db;
    color: #fff;
    box-shadow: inset 0 -3px 0 rgba(255,255,255,0.45);
}

/* Language switch, pinned to the right end of the bar */
.top-nav .lang-switch {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 13px 20px;
    background: rgba(255,255,255,0.10);
    border-left: 1px solid rgba(255,255,255,0.28);
    color: #fff;
    font-weight: 700;
}

.top-nav .lang-switch::before {
    content: "";
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cellipse cx='12' cy='12' rx='4.2' ry='9.5'/%3E%3Cpath d='M2.5 12h19M4.2 6.5h15.6M4.2 17.5h15.6'/%3E%3C/svg%3E");
    opacity: 0.9;
}

.top-nav .lang-switch:hover {
    background: rgba(255,255,255,0.22);
}

/* ---- HAPI banner, below the usage rules ----
 * .notice in ss_index.css is the red emergency notice, so announcements get
 * their own block. Its colours follow the navigation bar.
 */
.hapi-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 260px);
    align-items: center;
    gap: 22px;
    margin-bottom: 20px;
    padding: 18px 26px;
    background: linear-gradient(135deg, #33526b 0%, #24405a 55%, #1d3550 100%);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.20);
    color: #eaf2f8;
}

/* On the heading line: a line of its own only makes the banner taller */
.hapi-badge {
    display: inline-block;
    margin-right: 10px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #3498db;
    color: #fff;
    font-size: 0.47em;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    vertical-align: 0.32em;
    white-space: nowrap;
}

.hapi-banner h2 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 1.45em;
    font-weight: 700;
    line-height: 1.25;
}

.hapi-banner p {
    margin: 0 0 10px;
    font-size: 0.95em;
    line-height: 1.6;
    color: #d5e4f0;
}

.hapi-banner strong {
    color: #fff;
}

/* The figures behind "one gateway", as one-line chips */
.hapi-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}

.hapi-stats li {
    padding: 3px 11px;
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    font-size: 0.85em;
    line-height: 1.4;
    white-space: nowrap;
}

.hapi-stats b {
    color: #fff;
    font-size: 1.15em;
    font-weight: 700;
}

.hapi-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.hapi-cta {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 8px;
    background: #3498db;
    color: #fff;
    font-weight: 700;
    font-size: 1.02em;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.22);
    transition: background 0.2s;
}

.hapi-cta:hover {
    background: #4aa9e8;
    color: #fff;
    text-decoration: none;
}

.hapi-cta-secondary {
    display: inline-block;
    padding: 9px 18px;
    border: 1px solid rgba(255,255,255,0.45);
    border-radius: 8px;
    color: #eaf2f8;
    font-weight: 600;
    font-size: 0.95em;
    text-decoration: none;
    transition: background 0.2s;
}

.hapi-cta-secondary:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
    text-decoration: none;
}

.hapi-banner-thumb {
    margin: 0;
}

.hapi-banner-thumb img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.25);
    box-shadow: 0 3px 12px rgba(0,0,0,0.28);
}

/* ---- note shown before leaving for the Explorer ---- */
.hapi-modal {
    max-width: 560px;
    width: calc(100% - 32px);
    padding: 0;
    border: none;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    color: #333;
    font-family: inherit;
}

.hapi-modal::backdrop {
    background: rgba(20, 32, 45, 0.55);
}

.hapi-modal-head {
    padding: 20px 26px 16px;
    background: linear-gradient(135deg, #33526b 0%, #24405a 100%);
    color: #fff;
}

.hapi-modal-head h2 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 700;
    line-height: 1.3;
}

.hapi-modal-body {
    padding: 20px 26px 4px;
}

.hapi-modal-body p {
    margin: 0 0 12px;
    font-size: 0.95em;
    line-height: 1.6;
}

.hapi-modal-body ul {
    margin: 0 0 16px;
    padding-left: 22px;
    font-size: 0.92em;
    line-height: 1.6;
    color: #444;
}

.hapi-modal-body li {
    margin-bottom: 5px;
}

/* Rules of the road; the DOI and observatory paragraphs are toggled by JS */
.hapi-modal-ror {
    margin: 0 0 4px;
    padding: 13px 15px;
    border: 1px solid #e0c48a;
    border-left: 4px solid #d79f2b;
    border-radius: 6px;
    background: rgba(240, 200, 110, 0.13);
    font-size: 0.9em;
    line-height: 1.55;
}

.hapi-modal-ror > b {
    display: block;
    margin-bottom: 5px;
    font-size: 0.88em;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8a6410;
}

.hapi-modal-ror p {
    margin: 0 0 10px;
    font-size: 0.96em;
}

.hapi-modal-ror ul {
    margin: 0 0 10px;
    padding-left: 20px;
    font-size: 0.9em;
}

.hapi-modal-ror li {
    margin-bottom: 9px;
    word-break: break-word;
}

.hapi-modal-ror li b {
    color: #2c3e50;
}

.hapi-modal-ror a {
    color: #2980b9;
}

/* Caption of the banner figure */
.hapi-banner-thumb figcaption {
    margin-top: 7px;
    font-size: 0.8em;
    line-height: 1.45;
    color: #c3d6e6;
}

.hapi-modal-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 26px 20px;
}

/* Pushes the buttons to the right */
.hapi-modal-spacer {
    flex: 1 1 auto;
}

/* "Open Explorer" is a link (a new-tab link is never blocked on mobile), styled as a button */
.hapi-modal-foot button,
.hapi-modal-foot a.hapi-modal-go {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95em;
    font-weight: 600;
    line-height: normal;
    cursor: pointer;
}

.hapi-modal-foot a.hapi-modal-go,
.hapi-modal-foot a.hapi-modal-go:visited,
.hapi-modal-foot a.hapi-modal-go:hover {
    color: #fff;
    text-decoration: none;
}

.hapi-modal-cancel {
    background: #e9edf1;
    color: #4a5b6b;
}

.hapi-modal-cancel:hover {
    background: #dbe2e9;
}

.hapi-modal-go {
    background: #3498db;
    color: #fff;
}

.hapi-modal-go:hover {
    background: #2c8bcd;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .top-nav {
        margin: 0 10px 15px;
    }

    .top-nav ul {
        flex: 1 1 100%;
    }

    .top-nav li {
        flex: 1 1 30%;
        border-top: 1px solid rgba(255,255,255,0.14);
    }

    .top-nav li:nth-child(-n+3) {
        border-top: none;
    }

    .top-nav a {
        padding: 11px 10px;
        font-size: 0.85em;
    }

    .top-nav .lang-switch {
        flex: 1 1 100%;
        justify-content: center;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.28);
        padding: 11px 10px;
        font-size: 0.9em;
    }

    .hapi-banner {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 20px;
    }

    .hapi-banner h2 {
        font-size: 1.3em;
    }

    /* Narrow screens: text and buttons come before the figure */
    .hapi-banner-thumb {
        order: -1;
    }
}

@media (max-width: 480px) {
    .top-nav li {
        flex: 1 1 50%;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.14);
    }

    .top-nav li:nth-child(-n+2) {
        border-top: none;
    }

    .top-nav li:nth-child(even) {
        border-left: 1px solid rgba(255,255,255,0.14);
    }

    .hapi-cta,
    .hapi-cta-secondary {
        flex: 1 1 100%;
        text-align: center;
    }
}
