/* INdendro-web stylesheet */

/* --- Accessibility: screen-reader-only content (WCAG 2.4.1) --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link and other sr-only elements that become visible on focus */
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 8px 16px;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--navy);
    color: #fff;
    font-size: 1em;
    z-index: 10000;
    display: inline-block;
    text-decoration: none;
}

/* --- Accessibility: visible focus indicators (WCAG 2.4.7) --- */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus,
.Select-control:focus-within {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}

/* Dash DataTable cells get focus too */
.dash-cell.focused {
    outline: 2px solid var(--navy);
    outline-offset: -2px;
}

/* dcc.Dropdown shows its focus ring on the control container
   (.Select-control:focus-within, above). The tiny inner search input must NOT
   draw its own outline — when empty it is only a couple of pixels wide, so the
   outline renders as a vertical bar at the start of the selected value while
   the dropdown is open. */
.Select-input > input:focus {
    outline: none;
}

#packet_table {
    width: 200px;
}

/* Content gutter — the page content sits flush to the viewport otherwise.
   Give it a responsive horizontal margin that complements the plot's own
   margin. Header/nav/footer are centered and don't need this. */
#main-content {
    padding-left: clamp(16px, 3vw, 40px);
    padding-right: clamp(16px, 3vw, 40px);
}

/* --- Experimental-data disclaimer: one DIV, two states (workstream A) --- */
/* Shared base. Height/padding animate so the modal<->banner resize is smooth;
   non-animatable props (flex direction, font size) just swap. */
.disclaimer-notice {
    box-sizing: border-box;
    width: 100%;
    background: #fff8e1;            /* light amber */
    border: 1px solid #e0c068;
    border-left: 4px solid #8a6d00;
    color: #4a3a00;                 /* dark brown on amber — AA contrast */
    overflow: hidden;
    transition: min-height 0.3s ease, padding 0.3s ease;
}

/* Collapsed: the permanent inline banner below the status DIVs. */
.disclaimer-notice.banner {
    min-height: 0;
    padding: 8px 14px;
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 0.85em;
}
.disclaimer-notice.banner .disclaimer-heading {
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}
.disclaimer-notice.banner .disclaimer-text { margin: 0; }
/* Follow-up note: only shown in the expanded modal, not the terse banner. */
.disclaimer-notice .disclaimer-subnote { margin: 0; }
.disclaimer-notice.banner .disclaimer-subnote { display: none; }
.disclaimer-notice.banner .disclaimer-dismiss { display: none; }

/* Expanded: modal-like, elevated above the scrim. Stays inline (not fixed) so
   it never leaves its one place in the DOM; height grows instead. */
.disclaimer-notice.modal {
    position: relative;
    z-index: 1001;
    min-height: 60vh;
    padding: 8vh 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.1em;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
.disclaimer-notice.modal .disclaimer-heading {
    font-size: 1.6em;
    font-weight: 700;
    margin: 0 0 12px 0;
}
.disclaimer-notice.modal .disclaimer-text {
    max-width: 640px;
    margin: 0 0 24px 0;
}
.disclaimer-notice.modal .disclaimer-subnote {
    max-width: 640px;
    margin: 0 0 24px 0;
    font-size: 0.95em;
    font-style: italic;
}
.disclaimer-notice.modal .disclaimer-dismiss {
    display: inline-block;
    padding: 10px 28px;
    font-size: 1em;
    cursor: pointer;
    background: #4a3a00;           /* white on dark brown — AA contrast */
    color: #fff;
    border: none;
    border-radius: 4px;
}
.disclaimer-notice.modal .disclaimer-dismiss:hover { background: #342900; }

/* Backdrop scrim — full viewport, dims the page behind the modal. */
.disclaimer-scrim { display: none; }
.disclaimer-scrim.visible {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000;
}

@media (prefers-reduced-motion: reduce) {
    .disclaimer-notice { transition: none; }
}

/* --- Map popup: clickable Device ID (workstream B) --- */
.map-device-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0 0 4px 0;
    font: inherit;
    font-weight: 700;
    color: var(--navy);
    text-decoration: underline;
    cursor: pointer;
}
.map-device-link:hover { color: #003f8c; }

/* --- INdendro brand (Logo Kit v1) --- */
:root {
    --navy: #003263;        /* Forest Navy — "IN", headings, accents */
    --forest: #2c6a3e;      /* Forest Green — "dendro" */
    --forest-deep: #1f4d2e;
    --moss: #a7c08c;
    --paper: #f6f3ec;
    --ink: #15202b;
    --muted: #6a7480;
    --rule: #e0dacb;
    --bg: #eceadf;
}

/* Logo links home; strip link styling so the lockup renders as the wordmark.
   Focus ring is provided by the global a:focus rule. */
.indendro-home-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Primary lockup: mark · hairline rule · wordmark (IN navy / dendro green). */
.indendro-lockup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 14px 0 6px;
    flex-wrap: wrap;
}
.indendro-mark { height: 56px; width: auto; display: block; }
.indendro-rule { width: 1.5px; align-self: stretch; min-height: 46px; background: var(--rule); }
.indendro-wordmark-group { display: flex; flex-direction: column; gap: 2px; }
.indendro-wordmark {
    font-family: 'Archivo', system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: 2.2rem;
    line-height: 1;
    margin: 0;
    color: var(--navy);
}
.indendro-wordmark .d { color: var(--forest); font-weight: 600; }
.indendro-tagline {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 4px 0 0;
}

/* Section headings in brand (Archivo, Forest Navy). The wordmark H1 keeps its
   own class, so this targets the dashboard/admin section headings. */
h2, h3, h4 {
    font-family: 'Archivo', system-ui, sans-serif;
    color: var(--navy);
}

/* Site footer — funding / attribution (present on every page). */
.indendro-footer {
    border-top: 1px solid var(--rule);
    margin-top: 28px;
    padding: 18px 16px 30px;
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
}
.indendro-footer .eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--navy);
    margin: 0 0 6px;
}
.indendro-footer p { margin: 4px 0; }
.indendro-footer .grant { font-size: 0.72rem; color: var(--muted); }
.indendro-footer a {
    color: var(--navy);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
}
.indendro-footer a:hover { border-bottom-color: var(--navy); }
