/* =========================================
   America250 Hawai‘i — Global Stylesheet
   Last updated: 2025-08-29
   ========================================= */

/* =========================
   0) Root variables & base
   ========================= */
   :root {
    /* Colors */
    --clr-primary: #003366;
    --clr-accent: #967BB6;
    --clr-light: #f8f8f8;
    --clr-link: #6A8CAF;
  
    /* Layout */
    --container-w: 1200px;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
  
    /* Header height (content clearance) */
    --header-h: 110px; /* desktop/tablet estimate */
  }
  @media (max-width: 768px) {
    :root { --header-h: 140px; } /* mobile header is taller */
  }
  
  * { box-sizing: border-box; }
  html, body { height: 100%; margin: 0; }
  body {
    display: flex; flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #fff; color: #333; line-height: 1.6; font-size: 16px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }
  
  /* =========================
     1) Main layout & links
     ========================= */
  main {
    flex: 1;
    width: 100%;
    margin: 10px; /* light outer margin to avoid edge collisions */
    padding: calc(1rem + var(--header-h)) 1rem 1rem; /* clear fixed header */
    color: #000;
  }
  main a:hover,
  main a:focus {
    color: var(--clr-link);
    text-decoration: underline;
  }
  
  /* =========================
     2) Header (fixed)
     ========================= */
  header {
    position: fixed; inset: 0 auto auto 0; width: 100%;
    background: linear-gradient(to right, #ffc0cb 0%, #8b0000 100%);
    color: #fff; text-align: center; z-index: 1000;
    padding: 0.5rem 1rem;
  }
  .header-container {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; max-width: var(--container-w); margin: 0 auto; padding: 0 1rem;
  }
  .header-logos { display: flex; flex-direction: row; gap: 2rem; align-items: center; }
  .header-logo-img { max-height: 60px; width: auto; }
  
  .site-nav-links { white-space: normal; text-align: center; font-size: .9rem; line-height: 1.4; }
  .site-nav-links a {
    color: #fff; text-decoration: none; font-weight: bold;
    margin: 0 .25rem; display: inline-block; white-space: normal; padding: 0 .25rem;
  }
  .site-nav-links a:hover,
  .site-nav-links a:focus { text-decoration: underline; }
  
  .nav-links, .social-links { flex-shrink: 1; white-space: nowrap; }
  .social-links { display: flex; align-items: center; gap: 15px; }
  .social-links img { height: 40px; width: auto; cursor: pointer; }
  
  @media (max-width: 768px) {
    .header-container { flex-direction: column; align-items: center; gap: 10px; text-align: center; }
    .header-logos { justify-content: center; gap: 1.5rem; flex-wrap: nowrap; max-width: 300px; }
    .header-logo-img { max-height: 45px; }
    .site-nav-links a { font-size: .8rem; padding: .15rem .3rem; }
  }
  
  /* Optional test banner */
  .test-banner {
    width: 100%; background: #FFD700; color: white; text-align: center;
    padding: .5rem 0; font-weight: bold; font-size: 1rem; position: relative; z-index: 1000;
  }
  
  /* =========================
     3) Hero
     ========================= */
  .hero-intro {
    position: relative; height: 50vh; display: flex; align-items: flex-end; justify-content: flex-start;
    padding-left: 5vw; padding-bottom: 4vh; color: #fff;
  }
  .hero-content { position: relative; z-index: 2; max-width: 600px; top: 2rem; }
  .hero-content h1 { font-size: 4rem; margin: 0; letter-spacing: .05em; line-height: 1; }
  .hero-content .tagline { font-size: 1.25rem; font-weight: 300; margin-top: .25rem; letter-spacing: .02em; line-height: 1; }
  @media (max-width: 768px) {
    .hero-content h1 { font-size: 3rem; }
  }
  
  /* =========================
     4) Intro boxes & text
     ========================= */
  .america250-intro {
    max-width: 1275px; margin: 2rem auto; padding: 1.5rem;
    background-color: rgba(255,255,255,.8);
    border-radius: var(--radius); border: 2px solid #000; box-shadow: var(--shadow);
    overflow-wrap: anywhere; word-break: normal; hyphens: auto;
  }
  .america250-intro h1 { color: #000; font-size: 1rem; font-weight: normal; text-align: left; }
  .america250-intro h2, .america250-intro h3 { color: var(--clr-accent); text-align: center; }
  .america250-intro p { font-size: 1.05rem; line-height: 1.6; margin: .5rem 0 !important; display: block; }
  
  @media (max-width: 768px) {
    .america250-intro {
      margin-left: auto; margin-right: auto;
      width: 90vw; max-width: 480px;
      text-align: left;
    }
  }
  
  /* “Intro” family */
  .programs-intro, .in-the-news-intro, .gallery-intro, .calendar-intro {
    padding: 1.5rem; border-radius: var(--radius); border: 2px solid #000; box-shadow: var(--shadow);
    background-color: var(--clr-light); opacity: .8; width: 100%; margin: 2rem auto;
  }
  .in-the-news-intro { max-width: 100%; }
  .in-the-news-intro h2 { color: #E6E6FA; font-size: 1.3rem; font-weight: bold; text-align: center; }
  .in-the-news-intro ul { padding-left: 1rem; }
  .gallery-intro h3 { color: var(--clr-accent); font-size: 1.3rem; font-weight: normal; text-align: left; }
  .calendar-intro { max-width: 800px; }
  .calendar-intro h2, .calendar-intro h3 { color: #E6E6FA; }
  
  /* =========================
     5) Highlight boxes & buttons
     ========================= */
  .highlight-boxes {
    display: flex; flex-wrap: nowrap; justify-content: space-between; gap: 20px; margin-top: 2rem;
  }
  .highlight-box {
    display: flex; flex-direction: column; flex: 1 1 32%; min-width: 250px;
    border: 2px solid #111; border-radius: 15px; box-shadow: 0 4px 12px rgba(0,0,0,.1);
    overflow: hidden; background-color: #aaa; margin-bottom: 20px; padding: 1.5rem; color: #000; font-size: 2rem;
  }
  @media (max-width: 768px) {
    .highlight-boxes { flex-direction: column; align-items: center; }
    .highlight-box { flex: none; width: 90vw; max-width: 400px; font-size: 1.5rem; }
  }
  .highlight-header { background: #000; color: #fff; padding: 1.5rem; text-align: center; border-radius: 10px 10px 0 0; }
  .highlight-header img { max-height: 150px; width: auto; margin-bottom: 1rem; }
  .highlight-header h2 { margin: 0; font-size: 1.5rem; font-weight: bold; }
  .highlight-content { padding: 1rem 0; flex-grow: 1; font-size: 1rem; }
  .highlight-content p { margin: 0; font-size: 1rem; }
  .highlight-content ul { padding-left: 1.2rem; list-style: none; }
  .highlight-content a.purple-link:hover { color: #cebef0; text-decoration: underline; font-weight: bold; }
  .highlight-box .highlight-content { padding-bottom: 0; }
  
  .button-row {
    display: flex; justify-content: space-between; gap: 20px; margin: 0 auto 5rem; padding: 0 1rem;
    width: 100%; max-width: 1000px;
  }
  .highlight-buttons { display: flex; justify-content: space-between; gap: 1rem; width: 100%; }
  .highlight-button {
    background: #d9534f; color: whitesmoke; text-align: center; padding: .3rem 1rem; text-decoration: none;
    border-radius: 8px; font-weight: bold; font-size: 1rem; flex: 0 1 auto; border: 2px solid #000;
  }
  
  /* =========================
     6) Countdown
     ========================= */
  .countdown-banner {
    width: 100%; background: lightskyblue; color: #000; padding: 1rem; border-radius: var(--radius); border: 2px solid #000;
  }
  .countdown-banner h1 { color: #000; text-align: center; font-weight: bold; margin-top: 0; }
  .countdown-banner h3 { color: #000; font-weight: normal; margin-bottom: 0; }
  .highlight-box-countdown {
    background: lightskyblue; opacity: .8; background-size: cover; position: relative; border: 2px solid #000;
    border-radius: var(--radius); padding: 0; box-shadow: var(--shadow); text-align: center; height: auto; min-height: 100px; margin-bottom: .5rem;
  }
  .highlight-box-countdown h2 { margin: 1rem; font-size: 1.5rem; }
  .highlight-box-countdown h1 { margin: 1rem; font-size: 1rem; text-align: left; font-weight: normal; }
  .countdown-container {
    display: flex; justify-content: space-around; align-items: center; gap: 1rem; padding: 1rem; flex-wrap: wrap;
  }
  .time-box {
    background: lightskyblue; border: 2px solid #000; border-radius: 8px; padding: 1rem; min-width: 70px; text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.2); color: #000;
  }
  .time-box span { font-size: 2rem; font-weight: bold; display: block; color: #000; }
  .time-box .label { font-size: .9rem; font-weight: normal; margin-top: .3rem; color: #000; }
  
  /* =========================
     7) Teams / Commissioners
     ========================= */
  .team-container { max-width: var(--container-w); margin: 0 auto; padding: 2rem; }
  .team-heading { text-align: center; font-size: 2rem; margin-bottom: 2rem; }
  .team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2rem; }
  .team-member { text-align: center; }
  .team-member img {
    width: 100%; max-width: 200px; height: auto; border-radius: 10px; border: 2px solid #000; box-shadow: 0 2px 6px rgba(0,0,0,.2);
  }
  .team-member p { margin-top: .5rem; font-size: 1rem; color: #000; }
  
  .commissioner-grid,
  .educational-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem; max-width: var(--container-w); margin: 0 auto; padding: 2rem;
  }
  .commissioner-card,
  .educational-card {
    border: 2px solid #000; border-radius: var(--radius); overflow: hidden; text-align: center; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.1);
    opacity: .85;
  }
  .commissioner-card img,
  .educational-card img { width: 100%; height: 250px; object-fit: cover; display: block; }
  .commissioner-card h3,
  .educational-card h3 { margin: 0; padding: 1rem; font-size: 1rem; background: #f8f8f8; }
  
  /* =========================
     8) Education / Resources grids (rewritten)
     ========================= */
  /* Normalize across all education subpages, incl. French & Indian War */
  .educational-grid,
  .resource-grid {
    display: grid;
  
    /* Keep cards card-sized so 1–3 items don't sprawl full-width.
       When there’s room, additional columns will auto-fit. */
    grid-template-columns: repeat(auto-fit, minmax(260px, 340px));
  
    gap: 1.25rem;
  
    /* Center tracks when few items; easy toggle to 'start' if you prefer left-aligned */
    justify-content: center;
  
    align-items: stretch;
  }
  
  /* Each item fills its cell; avoid overflow from long titles */
  .educational-card,
  .resource-item {
    display: flex; flex-direction: column;
    height: 100%;
    min-width: 0; /* critical to prevent overflow in grid */
  }
  
  /* Consistent tile thumbnails */
  .educational-card img,
  .resource-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
    display: block;
  }
  
  /* Text spacing & safe wrapping */
  .educational-card h3,
  .resource-item a {
    margin-top: 0.75rem;
    overflow-wrap: anywhere;
  }
  
  /* Narrow phones: single column for readability */
  @media (max-width: 480px) {
    .educational-grid,
    .resource-grid {
      grid-template-columns: 1fr;
      justify-content: stretch; /* full width on very small screens */
    }
  }
  
  /* =========================
     9) Forms
     ========================= */
  .form-container {
    max-width: 700px; margin: 40px auto; background: rgba(255,255,255,.9); padding: 25px; border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,.15); border: 2px solid #000;
  }
  .form-container h2 { text-align: center; margin-bottom: 20px; color: #333; }
  .form-container label { display: block; margin-top: 15px; font-weight: bold; }
  .form-container input[type="text"],
  .form-container input[type="email"],
  .form-container input[type="tel"],
  .form-container input[type="url"],
  .form-container textarea,
  .form-container input[type="file"] {
    width: 100%; padding: 8px; margin-top: 5px; border-radius: 4px; border: 1px solid #ccc;
  }
  .form-container fieldset { margin-top: 20px; padding: 10px; border: 1px solid #ccc; border-radius: 4px; }
  .form-container fieldset label { display: block; margin-top: 5px; font-weight: normal; }
  .form-container button {
    margin-top: 20px; background: #0073e6; color: #fff; padding: 12px 20px; border: none; border-radius: 6px; cursor: pointer; font-size: 16px;
  }
  .form-container button:hover { background: #005bb5; }
  
  /* Generic form styles (secondary) */
  form input[type="text"],
  form input[type="email"],
  form input[type="tel"],
  form input[type="url"],
  form textarea,
  form input[type="file"],
  form select {
    width: 100%; max-width: 100%; padding: .5rem; margin-bottom: 1rem;
  }
  form fieldset { border: none; margin-bottom: 1rem; padding: 0; }
  form label { display: block; margin-top: .75rem; font-weight: 600; }
  form button {
    padding: .75rem 1.5rem; font-size: 1rem; background: var(--clr-primary); color: #fff; border: none; border-radius: 4px; cursor: pointer;
  }
  form button:hover { background: #0055aa; }
  @media (max-width: 768px) {
    .form-container { padding: .5rem; }
    form button { width: 100%; }
    form label, form input, form textarea, form fieldset, form button { font-size: 1rem; }
  }
  
  /* =========================
     10) Footer
     ========================= */
  footer {
    background: linear-gradient(to right, rgba(100,149,237,.85) 0%, rgba(0,0,80,.85) 100%);
    color: #fff; padding: 1rem; position: relative;
  }
  .footer-container {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
    width: 100%; max-width: var(--container-w); margin: 0 auto; padding: .5rem;
  }
  .footer-logo-img { height: 60px; width: auto; max-width: 100%; }
  .footer-social .social-icon { height: 40px; width: auto; margin-left: 10px; cursor: pointer; }
  .footer-contact { margin-top: .2rem; text-align: center; font-size: .8rem; color: #eee; }
  .footer-contact a { color: #ddd; text-decoration: underline; }
  .site-version { position: absolute; bottom: 8px; right: 8px; font-size: .65rem; color: #aaa; text-align: right; }
  
  @media (max-width: 767px) {
    .footer-container { flex-direction: column; align-items: center; text-align: center; gap: 1rem; }
    .social-links { justify-content: center; gap: 1rem; display: flex; }
    .site-version { position: static; margin-top: 1rem; text-align: center; color: #ccc; }
  }
  
  /* =========================
     11) Page backgrounds
     ========================= */
  body.home-page,
  body.education-page,
  body.about-page,
  body.get-involved,
  body.events-page,
  body.underconstruction-page,
  body.sigprograms-page,
  body.commissioners-page,
  body.in-the-news-page,
  body.search-page,
  body.contact-page { position: relative; }
  
  body.home-page::before,
  body.education-page::before,
  body.about-page::before,
  body.get-involved::before,
  body.events-page::before,
  body.underconstruction-page::before,
  body.sigprograms-page::before,
  body.commissioners-page::before,
  body.in-the-news-page::before,
  body.search-page::before,
  body.contact-page::before {
    content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center; background-repeat: no-repeat; z-index: -1;
  }
  
  body.home-page::before { background-image: url('/images/TWDiamondHead.jpg'); }
  body.education-page::before { background-image: url('images/USFlag.png'); opacity: .6; background-position: top left; }
  body.about-page::before { background-image: url('images/RJAkakaFalls.jpg'); }
  body.get-involved::before { background-image: url('images/TWBarkingSands43.jpg'); background-position: center top; }
  body.events-page::before { background-image: url('images/RJAkakaFalls.jpg'); opacity: .8; }
  body.underconstruction-page::before { background-image: url('images/RJHiloMaunaKea.jpg'); opacity: 1; }
  body.sigprograms-page::before { background-image: url('images/RJHiloMaunaKea.jpg'); }
  body.commissioners-page::before { background-image: url('images/Kamehameha.jpg'); opacity: .5; }
  body.in-the-news-page::before { background-image: url('images/RJKilauea.jpg'); opacity: .8; }
  body.search-page::before { background-image: url('images/TWWaikiki.jpg'); background-attachment: fixed; }
  
  /* =========================
     12) Menus / Dropdowns
     ========================= */
  .menu-item { position: relative; display: inline-block; }
  .dropdown-toggle { cursor: pointer; padding: 10px 15px; display: inline-block; color: #000; text-decoration: none; font-weight: 600; }
  .dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0; background: #fff; box-shadow: 0 4px 8px rgba(0,0,0,.15);
    border-radius: 4px; padding: 0; margin: 0; list-style: none; min-width: 220px; z-index: 1000;
  }
  .dropdown-menu li a {
    display: block; padding: 10px 15px; color: #333; text-decoration: none; font-weight: bold !important;
    transition: background-color .2s ease;
  }
  .dropdown-menu li a:hover { background: #f2f2f2; }
  .menu-item:hover .dropdown-menu,
  .menu-item:focus-within .dropdown-menu { display: block; }
  .dropdown-toggle::after { content: " ▼"; font-size: .6em; margin-left: 6px; }
  
  @media (max-width: 768px) {
    .menu-item { display: block; }
    .dropdown-menu { position: static; box-shadow: none; border-radius: 0; min-width: 100%; }
    .dropdown-menu li a { padding-left: 25px; }
  }
  
  a.search-icon { font-size: 1.4rem; }
  
  /* =========================
     13) Utilities / Misc
     ========================= */
  .content-section { padding: 2rem; }
  .logo img { height: 60px; }
  .hawaii-flag-link { flex-shrink: 0; }
  .hawaii-flag-img { height: 36px; width: auto; border: 1px solid #ccc; border-radius: 4px; cursor: pointer; }
  .calendar-wrapper { position: relative; width: 100%; padding-bottom: 75%; height: 0; overflow: hidden; margin-bottom: 2rem; }
  .calendar-wrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
  
  /* Remove any legacy wrapper constraints */
  .card-wrapper { max-width: none; margin: 0; }
  
  /* End of stylesheet */
  