/* Archive Museum — Aloha Palestine
   Lightweight overlay for legacy static HTML pages.
   Non-destructive: does not reset or override existing theme styles
   unless necessary for readability and mobile responsiveness. */

/* ── Archive banner ─────────────────────────────────────────────── */
#archive-museum-banner {
  position: sticky;
  top: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  border-bottom: 2px solid #e2b714;
}

#archive-museum-banner a {
  color: #e2b714;
  text-decoration: none;
  white-space: nowrap;
}

#archive-museum-banner a:hover {
  text-decoration: underline;
}

#archive-museum-banner .amb-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 11px;
  color: #e2b714;
  flex-shrink: 0;
}

#archive-museum-banner .amb-label svg {
  width: 14px;
  height: 14px;
  fill: #e2b714;
  flex-shrink: 0;
}

#archive-museum-banner .amb-info {
  flex: 1;
  text-align: center;
  color: #ccc;
}

#archive-museum-banner .amb-home {
  flex-shrink: 0;
}

/* ── Mobile responsiveness ──────────────────────────────────────── */
@media screen and (max-width: 980px) {
  body {
    overflow-x: hidden;
  }

  #page, #wrapper, .fix {
    max-width: 100% !important;
    width: auto !important;
    overflow-x: hidden;
  }

  /* Top-level menu only — do not match ul.children (submenus) */
  #nav > ul {
    width: auto !important;
  }

  img {
    max-width: 100%;
    height: auto;
  }

  object, embed, iframe {
    max-width: 100%;
  }

  table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
  }

  /* News/posts (.postwrap.fix): fluid column — mobile/tablet only (not desktop) */
  #wrapper {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  #container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  #maincontent {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  #content {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  #sidebar {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    clear: both;
  }

  .postwrap,
  .postwrap.fix {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .post-header {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
  }

  .hentry .title {
    width: auto !important;
    max-width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
  }

  .textcontent {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
}

@media screen and (max-width: 600px) {
  #archive-museum-banner {
    flex-wrap: wrap;
    font-size: 12px;
    padding: 0.4rem 0.6rem;
    gap: 0.25rem 0.5rem;
  }

  #archive-museum-banner .amb-info {
    order: 3;
    width: 100%;
    font-size: 11px;
  }

  #sidebar {
    margin-top: 1.5rem;
  }
}

/*
 * Mobile: one scroll surface only — legacy document inside the iframe scrolls; outer shell does not.
 */
@media screen and (max-width: 768px) {
  html {
    height: 100% !important;
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  body {
    height: 100% !important;
    margin: 0;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y pinch-zoom;
  }

  /* Beat theme #wrapper{width:960px}, nested .fix, and 980px width:auto quirks */
  #page,
  #wrapper {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  /* Avoid nested scroll traps from the old theme alongside body scroll (matches 980px #page/#wrapper/.fix) */
  #page,
  #wrapper,
  #container,
  #content,
  .fix {
    overflow: visible !important;
    max-height: none !important;
  }

  #container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Flash banner strip (AP_new.swf) — fluid width; inline 960px attributes overridden */
  #header {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /*
   * SWF banner: intrinsic 960×135 — Ruffle/object often ignore % sizing.
   * Pixel dimensions + wrapper height are applied by ArchiveLayout.astro (same-origin JS).
   */
  #header > div {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
  }

  #header object,
  #header embed,
  #header canvas {
    box-sizing: border-box;
  }

  /*
   * Nav: theme uses #nav ul{width:750px} + floated lis; 980px sets width:auto which grows with items — overflows viewport.
   * Use flex-wrap so links stay within 100% width.
   */
  #nav {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    height: auto !important;
    overflow: visible !important;
  }

  /*
   * Top-level menu bar only (#nav > ul). Using plain #nav ul also matched ul.children,
   * which applied display:flex !important and overrode the theme’s display:none — submenu
   * stayed visible even after refresh.
   */
  #nav > ul {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    float: none !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch;
    row-gap: 0;
  }

  #nav > ul > li {
    float: none !important;
    flex: 0 1 auto;
    max-width: 100%;
  }

  /* Submenus stay controlled by theme + dropdown.js (display:none until opened) */
  #nav ul.dropdown ul.children,
  #nav ul.dropdown li > ul {
    float: none !important;
    display: none;
    flex-direction: column;
  }

  #nav ul.dropdown li.menuhover > ul {
    display: block;
  }

  /* Wide title / footer columns from theme */
  .hentry .title {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    box-sizing: border-box;
  }

  #fcolumns_container {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
  }

  .fcol {
    max-width: 100% !important;
    box-sizing: border-box;
  }
}

/* ── Subtle typography polish ───────────────────────────────────── */
.textcontent, .entry-content, #textLeft, #textRight {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ── Site footer (static archive) ───────────────────────────────── */
.archive-site-footer {
  clear: both;
  margin: 1.5rem 0 0;
  padding: 1rem 1rem 1.25rem;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 12px;
  line-height: 1.5;
  color: #666;
  border-top: 1px solid #ddd;
  background: #fafafa;
}

.archive-site-footer p {
  margin: 0;
}

/* ── Print styles ───────────────────────────────────────────────── */
@media print {
  #archive-museum-banner {
    position: static;
    background: #fff;
    color: #000;
    border-bottom: 1px solid #999;
    box-shadow: none;
  }

  #archive-museum-banner a {
    color: #000;
  }
}
