.calendar-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

#calendar-img {
  width: 100%;
  height: auto;
  display: block;
}

/* General Styles */
body {
  margin: 0;
  background: #111;
  font-family: 'Jost', Arial, sans-serif;
  font-weight: 500; /* Jost Medium */
  color: white;
  overflow-x: hidden; /* Prevent horizontal scroll */
  overflow-y: auto;   /* Allow vertical scroll when needed */
}

/* Header */
header {
  background-color: #222;
  padding: 10px 15px;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.site-logo {
  max-height: 60px;
  width: auto;
}

header h1 {
  font-size: 1.6em;
  margin: 0;
  color: #ffd700;
}

header .tagline {
  font-size: 1em;
  color: #ccc;
  font-weight: normal;
}

/* Footer */
footer {
  background-color: #222;
  text-align: center;
  padding: 10px;
  font-size: 1em;
}

/* New: Inline footer row for contact and signup */
.footer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  width: 100%;
}

.footer-contact {
  font-family: 'Jost', Arial, sans-serif;
  color: #fff;
  font-size: 1em;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

footer a {
  color: #facc15;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Calendar Container */
.calendar-container {
  position: relative;
  width: 100%;
  background-color: black;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-direction: column;
}

/* Clickable Boxes */
.clickable-box, .split-box {
  position: absolute;
  width: 10.16%;
  aspect-ratio: 1 / 1;
  z-index: 10;
  /* Ensure boxes don't cause overflow issues */
  max-width: calc(100vw - 20px);
}

.half-box {
  display: block;
  width: 100%;
  height: 50%;
  overflow: visible;
  position: absolute;
  z-index: 10;
  /* Ensure boxes don't cause overflow issues */
  max-width: calc(100vw - 20px);
}

/* Split box container positioning */
.split-box {
  position: absolute;
  width: 10.16%;
  aspect-ratio: 1 / 1;
  z-index: 10;
}

/* Half box positioning within split box */
.split-box .half-box.top-half {
  top: 0;
  height: 50%;
  overflow: hidden;
}

.split-box .half-box.bottom-half {
  top: 50%;
  height: 50%;
  overflow: hidden;
}

.split-box .half-box {
  position: absolute;
  width: 100%;
}

/* Zoom effect */
.clickable-box img, .half-box img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
  pointer-events: none;
}

/* Split box images should behave like regular boxes - hidden by default, shown on hover */
.split-box .half-box img {
  opacity: 0;
  pointer-events: none;
  /* Ensure images fit properly within their half-box containers */
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Portrait-specific boost for zoom */
.zoom-boost:hover img {
  transform: translate(-50%, -50%) scale(1.6);
  opacity: 1;
  z-index: 999;
}

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

/* Orientation visibility toggles */
@media screen and (orientation: portrait) {
  .landscape-only {
    display: none;
  }
  .portrait-only {
    display: block;
  }
}

@media screen and (orientation: landscape) {
  .portrait-only {
    display: none;
  }
  .landscape-only {
    display: block;
  }
}

.zoom-a:hover img {
  transform: translate(-50%, -50%) scale(2);
}

.zoom-a img {
  width: 100%;
  height: auto;
}

.zoom-a:hover img {
  transform: translate(-50%, -50%) scale(2.5);
}

.zoom-a {
  display: inline-block;
}

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

.page-header h1 {
  font-family: 'Jost', Arial, sans-serif;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.page-header h2 {
  font-size: 1.2rem;
  font-weight: 400;
  color: #ccc;
}

.archive-month {
  color: #fff;
  font-weight: bold;
  text-align: center;
  font-size: 1.2rem;
  margin-top: 0.5rem;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
  transition: color 0.3s;
}

.archive-item a:hover .archive-month {
  color: #b22222;
}

/* FIXED: Landscape orientation styles */
@media screen and (orientation: landscape) {
  html, body {
    height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    /* Removed overflow: hidden to prevent clipping */
  }

  header, footer {
    flex-shrink: 0;
  }

  .calendar-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0; /* Allow container to shrink if needed */
  }

  .calendar-wrapper {
    height: 100%;
  }

  #calendar-img {
    height: auto;
    width: auto;
    max-height: calc(100vh - var(--hfpx, 100px));
    max-width: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
  }
}

header {
  background-color: #222;
  padding: 10px 15px;
  text-align: center;
}

header h1 {
  font-family: 'Jost', Arial, sans-serif;
  font-size: 1.6em;
  margin: 0;
  color: #ffd700;
}

header .tagline, header h2 {
  font-size: 1em;
  color: #ccc;
  font-weight: normal;
  margin: 0.5em 0 0 0;
}

.header-links {
  margin-top: 10px;
  text-align: center;
}

.header-links a {
  margin-right: 16px;
  color: #990000;
  font-size: 1em;
  text-decoration: none;
  font-weight: bold;
}

.header-links a:hover {
  text-decoration: underline;
}

/* Jost Medium 500 font */
@import url('https://fonts.googleapis.com/css2?family=Jost:wght@500&display=swap');

/* One-line responsive header */
.one-line-header {
  background: linear-gradient(to right, #111, #220000);
  padding: 10px 15px;
  font-family: 'Jost', sans-serif;
}

.header-bar {
  flex-wrap: nowrap;
  justify-content: space-between;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  text-align: center;
}

.site-logo {
  height: 40px;
  width: auto;
}

.title-text {
  font-size: 1.4rem;
  line-height: 1.1;
  display: flex;
  align-items: center;
}

.past-link {
  color: #990000;
  text-decoration: none;
  font-weight: bold;
}

.past-link:hover {
  text-decoration: underline;
}

@media screen and (max-width: 600px) {
  .header-bar {
  flex-wrap: nowrap;
  justify-content: space-between;
    flex-direction: column;
    align-items: center;
  }

  .title-text {
  font-size: 1.4rem;
  line-height: 1.1;
  display: flex;
  align-items: center;
}
}

/* --- HIDE ORIGINAL IMAGE ON HOVER FOR CLICKABLE-BOX AND HALF-BOX --- */
.clickable-box:hover img {
  opacity: 0 !important;
  transform: translate(-50%, -50%) scale(1) !important;
  box-shadow: none !important;
  z-index: 10 !important;
}

/* Split box half-box images should stay visible - zoom is handled differently */
.split-box .half-box:hover img {
  opacity: 1 !important;
  transform: translate(-50%, -50%) scale(1) !important;
  box-shadow: none !important;
  z-index: 10 !important;
}

.hover-zoom-img {
  will-change: transform, opacity, left, top, width, height;
  background: #111;
  transition: transform 0.3s cubic-bezier(.4,2,.6,1), opacity 0.3s cubic-bezier(.4,2,.6,1);
  opacity: 0;
  transform: scale(0.8);
}

.social-icons-inline i {
  color: #ccc;
  font-size: 1.2em;
  margin-right: 10px;
  transition: color 0.3s ease;
  text-decoration: none;
}

.social-icons-inline i:hover {
  color: #fff;
}

.social-icon {
  height: 20px;
  width: auto;
  filter: grayscale(100%);
  vertical-align: middle;
  margin-right: 10px;
  margin-top: -2px; /* aligns better with font icons */
  transition: filter 0.3s ease;
}

.social-icon:hover {
  filter: grayscale(0%);
  text-decoration: none;
}

/* Footer signup inline and minimal */
.footer-signup {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 0;
}

.footer-signup input[type="email"] {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #ffd700;
  background-color: #000;
  color: #fff;
  font-family: 'Jost', sans-serif;
  font-size: 0.8rem;
  width: 160px;
}

.footer-signup button {
  background: #990000;
  border: none;
  color: white;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Jost', sans-serif;
}

.footer-signup button:hover {
  background-color: #cc0000;
}

.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

/* Refined Dropdown Navigation */
.header-links {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown > a {
  font-size: 1.1rem;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  font-family: 'Jost', sans-serif;
  color: #ffd700;
  text-decoration: none;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: rgba(30, 30, 30, 0.95);
  min-width: 180px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  text-align: center;
  padding: 8px;
  animation: fadeIn 0.2s ease-in-out;
  top: 120%;
  right: 0;
}

.dropdown-content a {
  display: block;
  padding: 8px 16px;
  text-decoration: none;
  font-family: 'Jost', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: white;
  transition: background 0.2s ease, color 0.2s ease;
}

.dropdown-content a:hover {
  background-color: #444;
  color: #ffd700;
}

.dropdown:hover .dropdown-content {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.header-bar {
  justify-content: center !important;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}

.header-bar {
  justify-content: center !important;
  padding: 6px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}

.logo-icon {
  display: flex;
  align-items: center;
  height: 40px;
}

.title-text {
  font-size: 1.4rem;
  line-height: 1.1;
  display: flex;
  align-items: center;
}

.dropdown > a {
  font-size: 1.1rem;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  font-family: 'Jost', sans-serif;
  color: #ffd700;
  text-decoration: none;
}

.title-text {
  font-size: 1.2rem !important;
  font-family: 'Jost', sans-serif !important;
  font-weight: 500;
  display: flex;
  align-items: center;
  color: inherit;
}

.dropdown > a {
  font-size: 1.1rem !important;
  font-family: 'Jost', sans-serif !important;
  font-weight: 600;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  color: #ffd700;
  text-decoration: none;
}

.dropdown > a {
  font-size: 1.1rem !important;
  font-family: 'Jost', sans-serif !important;
  font-weight: 500 !important;
  color: #facc15 !important;  /* slightly softer gold */
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
  text-decoration: none;
}

/* === Movies header overrides === */
.movies .title-text {
  font-family: 'Cinzel', serif !important;
  font-weight: 700;
}
.movies .title-text span:first-child {
  margin-right: 0.35em;
}

/* FIXED: Portrait orientation styles */
@media screen and (orientation: portrait) {
  html, body {
    height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
  }

  header, footer {
    flex-shrink: 0;
  }

  .landscape-only {
    display: none;
  }
  .portrait-only {
    display: block;
  }

  .calendar-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: stretch;
    min-height: 0;
    overflow: hidden;
    position: relative;
  }

  .calendar-wrapper {
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
  }

  #calendar-img {
    height: 100% !important;
    width: auto !important;
    max-height: 100% !important;
    max-width: 100% !important;
    object-fit: contain !important;
    display: block !important;
    position: relative;
    z-index: 1;
    opacity: 1 !important;
  }
}

/* Portrait centering fix: removed - conflicts with full-screen fitting */

/* Portrait blurred edge fill */
@media screen and (orientation: portrait) {
  .calendar-container {
    position: relative;
    z-index: 0;
  }
  .calendar-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--portrait-bg);
    background-size: cover;
    background-position: center;
    filter: blur(20px);
    transform: scale(1.1);
    z-index: -1;
  }
}

/* === Portrait edge-fill background (blurred) === */
@media screen and (orientation: portrait) {
  .calendar-container {
    position: relative;
    overflow: hidden; /* hide blur bleed */
    isolation: isolate; /* ensure stacking context */
  }
  .calendar-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--calendar-bg, url('october-movies-portrait.webp'));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(24px) brightness(0.55);
    transform: scale(1.08); /* slight zoom so blur edges aren't visible */
    z-index: 0;
  }
  .calendar-wrapper {
    position: relative;
    z-index: 1; /* sit above blurred fill */
  }
}

/* --- Fix: consolidated into main portrait rule above --- */

@media screen and (orientation: landscape) {
  #calendar-img {
    display: block;
    margin: 0 auto; /* center horizontally */
  }
}

/* === Landscape edge-fill background (subtle) === */
@media screen and (orientation: landscape) {
  .calendar-container {
    position: relative;
    overflow: hidden;
    isolation: isolate;
  }
  .calendar-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--calendar-bg, url('october-movies-landscape.webp'));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(18px) brightness(0.75); /* subtler than portrait */
    transform: scale(1.05);
    z-index: 0;
    pointer-events: none;
  }
  .calendar-wrapper {
    position: relative;
    z-index: 1;
  }
  #calendar-img {
    position: relative;
    z-index: 1;
    opacity: 1 !important;
    display: block;
    margin: 0 auto;
  }
}

/* === Landscape edge-fill background (subtle) === */
@media screen and (orientation: landscape) {
  .calendar-container {
    position: relative;
    overflow: hidden;
    isolation: isolate;
  }
  .calendar-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--calendar-bg, url('october-movies-landscape.webp'));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(16px) brightness(0.65);
    transform: scale(1.06);
    z-index: 0;
    pointer-events: none;
  }
  .calendar-wrapper,
  #calendar-img {
    position: relative;
    z-index: 1;
  }
}

/* Subtle shadow for clickable boxes to separate from bg */
.clickable-box, .split-box, .half-box {
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  border-radius: 8px;
}

/* Footer icon theme for October Movies */
.movies .social-icons-inline i,
.movies .social-icon {
  color: #B22222 !important; /* deep red */
  filter: none !important;
}
.movies .social-icons-inline i:hover,
.movies .social-icon:hover {
  color: #FFD700 !important; /* gold on hover */
  filter: none !important;
}

@media screen and (orientation: landscape) {
  :root {
    --edge-brightness-landscape: 0.65; /* was ~0.7 */
    --edge-blur-landscape: 14px;       /* slightly softer than portrait */
  }
  .calendar-container::before {
    filter: blur(var(--edge-blur-landscape)) brightness(var(--edge-brightness-landscape));
  }
  .calendar-container::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at center,
      rgba(0,0,0,0) 55%,
      rgba(0,0,0,0.22) 100%);
  }
  .calendar-wrapper { z-index: 1; }
}

/* ===== Refined Visual Tweaks ===== */

/* Edge blur tuning + stronger vignette for max poster focus */
@media screen and (orientation: portrait) {
  :root {
    --edge-brightness: 0.5; /* darker for focus */
    --edge-blur: 26px;
  }
  .calendar-container::before {
    filter: blur(var(--edge-blur)) brightness(var(--edge-brightness));
  }
  .calendar-container::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at center,
      rgba(0,0,0,0) 50%,
      rgba(0,0,0,0.35) 100%);
  }
  .calendar-wrapper { z-index: 1; }
}

@media screen and (orientation: landscape) {
  :root {
    --edge-brightness: 0.5; /* match portrait darkness */
    --edge-blur: 22px;
  }
  .calendar-container::before {
    filter: blur(var(--edge-blur)) brightness(var(--edge-brightness));
  }
  .calendar-container::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at center,
      rgba(0,0,0,0) 50%,
      rgba(0,0,0,0.35) 100%);
  }
  .calendar-wrapper { z-index: 1; }
}

/* More visible micro shadows on boxes */
.clickable-box, .half-box {
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.4));
}
.clickable-box::after, .half-box::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08),
    0 8px 20px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.clickable-box:hover::after, .half-box:hover::after {
  opacity: 0.95;
}

/* Footer icons: original greyscale, gold hover */
.footer-row .footer-icon i,
.social-icons-inline i,
.social-icon {
  filter: grayscale(100%) brightness(0.85);
  transition: filter 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  color: inherit; /* keep original color scheme if applied */
}
.footer-row .footer-icon i:hover,
.social-icons-inline i:hover,
.social-icon:hover {
  filter: grayscale(0%) brightness(1);
  color: #ffd700; /* gold */
  box-shadow: 0 0 8px rgba(255,215,0,0.4);
}

/* ===== FINAL OVERRIDES (ensure they win) ===== */

/* 1) Footer icons: greyscale default, gold on hover (override any earlier red rules) */
body.movies footer .social-icons-inline i,
body.movies footer .footer-icon i,
body.movies footer .social-icon {
  color: inherit !important;
  filter: grayscale(100%) brightness(0.85) !important;
  transition: filter 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
body.movies footer .social-icons-inline i:hover,
body.movies footer .footer-icon i:hover,
body.movies footer .social-icon:hover {
  filter: grayscale(0%) brightness(1) !important;
  color: #ffd700 !important;
  box-shadow: 0 0 8px rgba(255,215,0,0.4);
}

/* 2) Edge blur + vignette: stronger, inside actual media queries */
@media screen and (orientation: portrait) {
  .calendar-container::before {
    filter: blur(26px) brightness(0.5) !important;
    transform: scale(1.08) !important;
  }
  .calendar-container::after {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    pointer-events: none !important;
    z-index: 0 !important;
    background: radial-gradient(ellipse at center,
      rgba(0,0,0,0) 50%,
      rgba(0,0,0,0.35) 100%) !important;
  }
  .calendar-wrapper { z-index: 1 !important; }
}

@media screen and (orientation: landscape) {
  .calendar-container::before {
    filter: blur(22px) brightness(0.5) !important;
    transform: scale(1.06) !important;
  }
  .calendar-container::after {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    pointer-events: none !important;
    z-index: 0 !important;
    background: radial-gradient(ellipse at center,
      rgba(0,0,0,0) 50%,
      rgba(0,0,0,0.35) 100%) !important;
  }
  .calendar-wrapper { z-index: 1 !important; }
}

/* 3) More visible box shadows */
.clickable-box, .half-box {
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.45)) !important;
}
.clickable-box::after, .half-box::after {
  content: "" !important;
  position: absolute !important;
  inset: -2px !important;
  border-radius: 14px !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08),
    0 10px 24px rgba(0,0,0,0.45) !important;
  opacity: 0 !important;
  transition: opacity 0.2s ease !important;
  pointer-events: none !important;
}
.clickable-box:hover::after, .half-box:hover::after {
  opacity: 0.95 !important;
}

/* ===== VISIBILITY BOOST (stronger, obvious) ===== */

/* Darker edges + stronger vignette */
@media screen and (orientation: portrait) {
  .calendar-container::before {
    filter: blur(28px) brightness(0.45) !important;
    transform: scale(1.08) !important;
  }
  .calendar-container::after {
    background: radial-gradient(ellipse at center,
      rgba(0,0,0,0) 46%,
      rgba(0,0,0,0.50) 100%) !important;
  }
}

/* Landscape too */
@media screen and (orientation: landscape) {
  .calendar-container::before {
    filter: blur(24px) brightness(0.45) !important;
    transform: scale(1.06) !important;
  }
  .calendar-container::after {
    background: radial-gradient(ellipse at center,
      rgba(0,0,0,0) 46%,
      rgba(0,0,0,0.50) 100%) !important;
  }
}

/* Give the main calendar a faint rim so it stands apart from the blurred fill */
.calendar-wrapper {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.05), 0 0 24px rgba(0,0,0,0.35);
}

/* Heavier tile separation */
.clickable-box, .half-box {
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.55)) !important;
}
.clickable-box::after, .half-box::after {
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.10),
    0 12px 28px rgba(0,0,0,0.55) !important;
}

/* ===== Gold/Red Tint Visual Boost ===== */

/* Portrait gold/red tinted edges */
@media screen and (orientation: portrait) {
  .calendar-container::before {
    background: linear-gradient(to bottom right, rgba(255,215,0,0.15), rgba(178,34,34,0.15)),
                var(--calendar-bg, url('october-movies-portrait.webp'));
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;
    filter: blur(28px) brightness(0.48) saturate(0.9) !important;
  }
  .calendar-container::after {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    pointer-events: none !important;
    z-index: 0 !important;
    background: radial-gradient(ellipse at center,
      rgba(0,0,0,0) 46%,
      rgba(0,0,0,0.5) 100%) !important;
  }
  .calendar-wrapper { z-index: 1 !important; }
}

/* Landscape gold/red tinted edges */
@media screen and (orientation: landscape) {
  .calendar-container::before {
    background: linear-gradient(to bottom right, rgba(255,215,0,0.15), rgba(178,34,34,0.15)),
                var(--calendar-bg, url('october-movies-landscape.webp'));
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;
    filter: blur(24px) brightness(0.48) saturate(0.9) !important;
  }
  .calendar-container::after {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    pointer-events: none !important;
    z-index: 0 !important;
    background: radial-gradient(ellipse at center,
      rgba(0,0,0,0) 46%,
      rgba(0,0,0,0.5) 100%) !important;
  }
  .calendar-wrapper { z-index: 1 !important; }
}

/* Clickable boxes gold glow idle → red glow hover */
.clickable-box::after, .half-box::after {
  content: "" !important;
  position: absolute !important;
  inset: -2px !important;
  border-radius: 14px !important;
  box-shadow:
    0 0 8px rgba(255,215,0,0.4),
    0 12px 28px rgba(0,0,0,0.55) !important;
  opacity: 0 !important;
  transition: opacity 0.2s ease, box-shadow 0.2s ease !important;
  pointer-events: none !important;
}
.clickable-box:hover::after, .half-box:hover::after {
  opacity: 0.95 !important;
  box-shadow:
    0 0 8px rgba(178,34,34,0.6),
    0 12px 28px rgba(0,0,0,0.65) !important;
}

/* ===== Header & Footer Blend into Background ===== */
.one-line-header, footer {
  background: transparent;
  position: relative;
  z-index: 2;
}

.one-line-header::before, footer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom right, rgba(255,215,0,0.10), rgba(178,34,34,0.10)),
    var(--calendar-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(18px) brightness(0.55) saturate(0.9);
  transform: scale(1.06);
  pointer-events: none;
  /* keeps text readable on busy art */
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.06);
}

.one-line-header {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
footer {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Slight fade edges so header/footer feel embedded */
.one-line-header::after, footer::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 12px;
  pointer-events: none;
}
.one-line-header::after { bottom: -1px; background: linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(0,0,0,0)); }
footer::after { top: -1px; background: linear-gradient(to top, rgba(0,0,0,0.25), rgba(0,0,0,0)); }

/* === Seamless background: remove header/footer gaps === */

/* Single shared blurred/tinted background behind everything */
body.movies {
  position: relative;
  background: transparent;
}
body.movies::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;                /* sits behind all content */
  pointer-events: none;
  background:
    linear-gradient(to bottom right, rgba(255,215,0,0.15), rgba(178,34,34,0.15)),
    var(--calendar-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(24px) brightness(0.5) saturate(0.9);
  transform: scale(1.06);
}

/* Make header, footer, and calendar sit above the shared layer */
.one-line-header, footer, .calendar-container {
  position: relative;
  z-index: 1;
  background: transparent;
}

/* Remove extra fades/lines that can look like gaps */
.one-line-header::after, footer::after {
  display: none !important;
}

/* Disable the per-container blur layer to avoid double-stacking */
.calendar-container::before {
  content: none !important;
}

/* === Improved contrast for blended header/footer === */
.one-line-header, footer {
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.85), 0 0 5px rgba(0,0,0,0.65);
}

.one-line-header a, footer a {
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.85), 0 0 5px rgba(0,0,0,0.65);
}

.one-line-header a:hover, footer a:hover {
  color: gold !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 6px rgba(255,215,0,0.75);
}

/* Footer social icons stronger contrast */
footer .social-icons a {
  filter: brightness(1.15) contrast(1.1) grayscale(100%);
  transition: filter 0.25s ease, color 0.25s ease;
}
footer .social-icons a:hover {
  filter: brightness(1.3) contrast(1.15) grayscale(0%);
  color: gold !important;
}

/* === Legibility Boost for Blended Header/Footer (non-intrusive) === */
body.movies .one-line-header,
body.movies footer {
  /* tiny dark scrim so text has consistent contrast on busy art */
  background-color: rgba(0,0,0,0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Header text/icon contrast */
body.movies .one-line-header .title-text,
body.movies .one-line-header .past-link,
body.movies .one-line-header .header-bar a,
body.movies .one-line-header .header-bar i {
  text-shadow: 0 2px 8px rgba(0,0,0,0.65);
}

/* Stronger hover/focus glow on interactive header items */
body.movies .one-line-header .header-bar a:hover,
body.movies .one-line-header .header-bar a:focus {
  filter: drop-shadow(0 0 6px rgba(255,215,0,0.65));
}

/* Footer icons: ensure readable on blend; keep greyscale→gold */
body.movies footer .social-icons-inline i,
body.movies footer .footer-icon i,
body.movies footer .social-icon {
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

/* Newsletter label/input contrast tweak */
body.movies footer .footer-signup label {
  color: #f3f3f3;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
body.movies footer .footer-signup input[type="email"] {
  background-color: rgba(0,0,0,0.45);
  border-color: rgba(255,215,0,0.7);
}
body.movies footer .footer-signup button {
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

/* Keep layout locked: no accidental margins */
body.movies .one-line-header,
body.movies footer { margin: 0; padding-top: 10px; padding-bottom: 10px; }

/* Share toast */
#share-toast{
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 9999;
}
#share-toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Consistent spacing for the title hyphen */
.title-hyphen { 
  display: inline-block; 
  margin: 0 6px; 
}

/* --- Kebab (3-dot) menu --- */

.kebab-btn i{ font-size: 18px; color: #f8fafc; }

.kebab-menu{
  position: absolute;
  top: 56px;
  right: auto;
  min-width: 220px;
  background: rgba(17,17,17,0.96);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  padding: 8px;
  display: none; /* hidden by default */
  z-index: 10000;
}
.kebab-menu.open{ display: block; }

.kebab-menu hr{
  border: none;
  height: 1px;
  background: transparent;
  margin: 6px 4px;
}

.kebab-item{
  border-radius: 10px;
  margin: 2px 4px;
  width: calc(100% - 8px);

  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 600;
  color: #f8fafc;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}
.kebab-item i{ opacity: 0.9; }
.kebab-item:hover{ background: transparent; color:#facc15; }
.kebab-item:active{ background: transparent; }

/* ensure button variant doesn't inherit default UA button styles */


.kebab-item:hover i{ color:#facc15; opacity:1; }


.kebab-btn i {
  font-size: 18px;
  color: #FFD700;
}
.kebab-btn:hover {
  box-shadow: 0 0 8px #FFD700;
  border-color: #FFD700;

  box-shadow: 0 0 14px rgba(255,215,0,0.55);
}

.kebab-btn {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 2px solid #FFD700;
  border-radius: 50%;
  padding: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  z-index: 1100;

  box-shadow: 0 0 6px rgba(255,215,0,0.25);
  transition: box-shadow 180ms ease;
}
.kebab-btn i {
  font-size: 18px;
  color: #FFD700;
}
.kebab-btn:hover {
  box-shadow: 0 0 8px #FFD700;
  border-color: #FFD700;

  box-shadow: 0 0 14px rgba(255,215,0,0.55);
}
.header-bar { position: relative; }

.kebab-btn:focus-visible { box-shadow: 0 0 18px rgba(255,215,0,0.65); outline: none; }

.footer-social a:hover i {
  color: #FFD700;
  text-shadow: 0 0 8px rgba(255,215,0,0.6);
  transition: color 0.18s ease, text-shadow 0.18s ease;
}

.footer-social i { color: #e5e7eb; }

/* NMM_KEBAB_PANEL_MIN */
.one-line-header{ position:relative; z-index:2000; }
.kebab-btn{ position:absolute; top:50%; transform:translateY(-50%); z-index:2100; }
.kebab-panel{
  position:fixed;
  top: var(--kebab-panel-top, 56px);
  left: var(--kebab-panel-left, 12px);
  width: 220px;
  background: rgba(15,15,15,0.92);
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.45), 0 0 18px rgba(255,215,0,0.18);
  z-index: 2050;
}
.kebab-panel[hidden]{ display:none !important; }
.kebab-panel ul{ list-style:none; margin:0; padding:0; }
.kebab-panel li{ margin:0; }
.kebab-panel a, .kebab-panel a:visited{
  display:flex; align-items:center; gap:10px;
  padding:9px 8px; color:#eee; text-decoration:none; border-radius:8px;
  font-family:'Jost', sans-serif; font-weight: 500; font-size:0.95rem;
}
.kebab-panel a:hover{ background: rgba(255,215,0,0.08); }
.kebab-panel .divider{ height:1px; margin:6px 4px; background: rgba(255,255,255,0.08); }

/* ——— Kebab: force perfect circle ——— */
.kebab-btn{
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px !important;
  height: 40px !important;
  aspect-ratio: 1 / 1;
  padding: 0 !important;
  box-sizing: border-box;
  border: 2px solid #FFD700;
  border-radius: 9999px !important;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(3px);
}
.kebab-btn i{ font-size: 18px; line-height: 1; color: #FFD700; }

@media (max-width: 480px){
  .kebab-btn{ width: 36px !important; height: 36px !important; }
  .kebab-btn i{ font-size: 16px; }
}

/* ——— Brand group: logo left of title, single line ——— */
.one-line-header .header-bar{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center; /* keeps the pair centered */
}

.brand-group{
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
}

.brand-group .site-logo{
  position: static !important;
  margin: 0 !important;
  flex: 0 0 auto;
  height: 40px; /* adjust if you like */
  width: auto;
}

.brand-group .title-text{
  position: static !important;
  left: auto !important;
  transform: none !important;
  display: inline-block !important;
  white-space: nowrap;         /* prevent wrapping underneath the logo */
  flex: 0 0 auto;
  text-align: left !important;
}

/* === Calendar bleed/blur background (portrait + landscape) === */
.calendar-container{
  position: relative;
  overflow: hidden;
  isolation: isolate;              /* keep pseudo elements contained */
}

/* blurred full-bleed bg pulled from the same calendar image */
.calendar-container::before{
  content:"";
  position:absolute;
  inset:0;
  background-image: var(--calendar-bg, none);
  background-position:center;
  background-repeat:no-repeat;
  background-size:cover;
  filter: blur(28px);
  transform: scale(1.08);          /* push blur beyond edges */
  z-index:0;
  pointer-events:none;
}

/* subtle movies-theme vignette/tint so edges blend nicely */
.calendar-container::after{
  content:"";
  position:absolute;
  inset:-2px;                      /* hide blur edge */
  background: radial-gradient(ellipse at center,
              rgba(178,34,34,0.22) 0%,
              rgba(0,0,0,0.45) 55%,
              rgba(0,0,0,0.80) 100%);
  z-index:1;
  pointer-events:none;
}

/* make sure the actual image & hotspots sit above the blur */
.calendar-wrapper{ position:relative; z-index:2; }
#calendar-img{ display:block; object-fit:contain; }
.clickable-box, .half-box{ position:absolute; z-index:3; }
/* Re-enable calendar bleed layer */
.calendar-container::before { content: "" !important; }

/* NMM_TILES_NO_BASE_RING (final override) */
.clickable-box::after,
.half-box::after{
  box-shadow: none !important;
  opacity: 0 !important;
}

/* NMM_KILL_TILE_RING — remove any baseline ring on clickable tiles */
.clickable-box,
.half-box{
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
.clickable-box::before,
.clickable-box::after,
.half-box::before,
.half-box::after{
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  opacity: 0 !important;
}
/* keep hover glow only (optional; comment out if you don't want any hover) */
.clickable-box:hover::after,
.half-box:hover::after{
  opacity: .95 !important;
  box-shadow:
    0 0 8px rgba(178,34,34,.6),
    0 12px 28px rgba(0,0,0,.65) !important;
}

/* Add a fallback for older browsers that don't support CSS custom properties */
@supports not (height: calc(100vh - var(--hfpx))) {
  @media screen and (orientation: portrait) {
    #calendar-img {
      max-height: calc(100vh - 120px);
    }
  }
  
  @media screen and (orientation: landscape) {
    #calendar-img {
      max-height: calc(100vh - 100px);
    }
  }
}

/* === Movies footer: subscribe icon + modal (scoped) === */
footer .social-icons-inline .footer-subscribe i{ position:relative; display:inline-block; }
footer .social-icons-inline .footer-subscribe i::after{
  content:"+"; position:absolute; right:-3px; top:-3px; width:12px; height:12px;
  border-radius:50%; display:grid; place-items:center;
  background:var(--accent, #e6b800); color:#000; font-weight:700; font-size:9px;
  box-shadow:0 0 6px var(--accent, #e6b800);
}

/* Minimal modal styles; do not affect layout elsewhere */
.nm-modal{ 
  border:0; border-radius:16px; padding:18px; background:#111; color:#fff; 
  max-width:360px; width:min(92vw, 360px);
  font-family: 'Jost', sans-serif !important; font-weight: 500 !important;
}
.nm-modal::backdrop{ background:rgba(0,0,0,.6); }
.nm-modal h3{ 
  margin:0 0 10px; font-size:18px; 
  font-family: 'Jost', sans-serif !important; font-weight: 500 !important; 
}
.nm-modal input{ 
  width:100%; padding:10px 12px; border-radius:10px; border:1px solid #444; 
  background:#000; color:#fff; 
  font-family: 'Jost', sans-serif !important; font-weight: 500 !important;
}
.nm-modal__actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:10px; }
.nm-modal__actions button{ 
  border:0; border-radius:10px; padding:8px 12px; cursor:pointer;
  font-family: 'Jost', sans-serif !important; font-weight: 500 !important;
}
.nm-modal__actions button[type="submit"]{ background:var(--accent, #e6b800); color:#000; font-weight:600 !important; }
.nm-modal__x{ position:absolute; top:8px; right:10px; background:transparent; border:0; color:#fff; font-size:20px; cursor:pointer; }
.nm-modal__note{ 
  opacity:.8; font-size:13px; margin-top:8px; line-height: 1.4;
  font-family: 'Jost', sans-serif !important; font-weight: 500 !important; 
}
.nm-modal__msg{ 
  margin-top:6px; font-size:13px; color:#9fffcb; 
  font-family: 'Jost', sans-serif !important; font-weight: 500 !important; 
}

/* === Wrapper badge (isolated from icon filters) === */
footer .social-icons-inline .icon-with-badge{ position:relative; display:inline-block; line-height:1; }
footer .social-icons-inline .icon-with-badge .badge-plus{
  position:absolute; right:-3px; top:-3px; width:12px; height:12px;
  display:grid; place-items:center; border-radius:50%;
  background:var(--accent, #e6b800); color:#000; font-weight:700; font-size:9px;
  box-shadow:0 0 6px rgba(230,184,0,0.6); pointer-events:none; z-index:2; filter:none !important;
}
/* Turn off any previous pseudo-badge */
footer .social-icons-inline .footer-subscribe i::after{ content:none !important; }



/* === Wrapper badge alignment tweaks (match Games look) === */
footer .social-icons-inline .icon-with-badge{
  position:relative; display:inline-flex; align-items:center;
  margin-right: 10px; /* replace the inner <i>'s default margin */
}
footer .social-icons-inline .icon-with-badge .footer-subscribe i{
  margin-right: 0 !important; /* prevent double spacing */
  position: relative;
}
footer .social-icons-inline .icon-with-badge .badge-plus{
  right:-3px; top:-3px; width:12px; height:12px; font-size:9px;
  background:#e6b800; box-shadow:0 0 6px rgba(230,184,0,0.6);
}
@media (max-width:600px){
  footer .social-icons-inline .icon-with-badge .badge-plus{ right:-2px; top:-2px; width:11px; height:11px; font-size:8px; }
}

/* Footer site cross-links */
footer .site-links{
  display:inline-flex; align-items:center; gap:12px; margin-left:12px;
}
footer .site-links .site-link{ display:inline-block; line-height:1; }
footer .site-links .site-logo{
  height:26px; width:auto; vertical-align:middle; border-radius:6px;
  filter:none !important;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
footer .site-links .site-link:hover .site-logo,
footer .site-links .site-link:focus-visible .site-logo{
  transform: translateY(-1px);
  box-shadow: 0 0 10px var(--accent, #e6b800);
  outline: none;
}
@media (max-width:600px){
  footer .site-links{ gap:10px; margin-left:8px; }
  footer .site-links .site-logo{ height:24px; }
}

/* Hide the current site's own icon automatically (works on all sites) */
footer .site-links .site-link[style*="display: none"] { display:none !important; } /* safety */

/* Floating preview (desktop only) */
#nm-footer-preview{
  position:fixed; display:none; pointer-events:none; z-index:9999;
}
#nm-footer-preview img{
  width:260px; height:auto; border-radius:12px;
  box-shadow:0 8px 30px rgba(0,0,0,.45);
}
@media (max-width:1024px){
  #nm-footer-preview{ display:none !important; }
}

/* === Mobile LANDSCAPE clipping/scroll fixes === */
@media (orientation: landscape) and (pointer:coarse){
  /* make sure the page can grow & scroll if needed */
  html, body { height:auto; min-height:100%; overflow:auto; }

  /* give the calendar enough vertical room under the footer */
  .calendar-container{
    min-height: calc(100dvh - var(--hfpx));
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    overflow: visible; /* allow children to poke out a bit */
  }

  /* avoid any internal clipping from the wrapper */
  .calendar-wrapper{ overflow: visible; }

  /* gentle zoom that won’t push bottom tiles past the viewport too far */
  .clickable-box img{ transform-origin: center; }
  .clickable-box:active img{ transform: scale(1.02); }
}



/* Hide Movies icon on Movies site */
footer .site-links .site-link--movies { display: none !important; }
footer .site-links .site-link--hub { display: inline-block !important; }

/* Footer copyright */
.footer-copyright {
  text-align: center;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #888;
  font-family: 'Jost', sans-serif;
}


/* === NMM_KEBAB_BRAND_GUARD (mobile portrait only) === */
@media (max-width: 520px) and (orientation: portrait) {
  .one-line-header { position: relative; }
  /* Reserve space left of the brand equal to kebab width + a small gap */
  .brand-group {
    padding-left: calc(var(--kebab-reserve, 44px) + max(8px, env(safe-area-inset-left)));
  }
  /* Slight logo/title shrink to reduce chance of collision on tiny phones */
  .one-line-header .site-logo { height: 26px; }
  .one-line-header .title-text { font-size: 1.15rem; line-height: 1.1; }
}


/* === NMM_PREVIEW_BADGE === */
.preview-badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1;
  padding: 4px 8px;
  margin-left: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,215,0,0.85);
  color: #FFD700;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(2px);
  white-space: nowrap;
  user-select: none;
}
.preview-badge::after{
  content: "• Final dates TBC";
  font-weight: 500;
  opacity: 0.9;
  margin-left: 6px;
}
@media (max-width: 520px) and (orientation: portrait){
  .preview-badge{
    font-size: 11px;
    padding: 3px 6px;
  }
  .preview-badge::after{
    content: "• TBC";
  }
}

/* === Anti-sticky-hover failsafe === */
body.nm-kill-hover .calendar-wrapper,
body.nm-kill-hover .clickable-box,
body.nm-kill-hover .half-box {
  pointer-events: none !important;
}

/* Ensure any flagged hover overlays fully disappear when [hidden] */
#hoverPreview[hidden],
.hover-preview[hidden],
.hover-zoom[hidden],
.hover-card[hidden],
.hover-image[hidden],
#nm-hover[hidden] {
  display: none !important;
}


/* === Footer preview bubble (new, avoids old hover-kill) === */
#footer-preview-bubble {
  position: fixed;
  width: 280px;
  height: 158px; /* ~16:9 */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -10px);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 3500;
}
#footer-preview-bubble.is-visible {
  opacity: 1;
  transform: translate(-50%, -16px);
}

/* === Mobile tap fix: keep boxes tappable even when nm-kill-hover is active === */
body.nm-kill-hover .calendar-wrapper,
body.nm-kill-hover .clickable-box,
body.nm-kill-hover .half-box {
  pointer-events: auto !important;
}

/* === MOBILE VIEWPORT FIXES === */

/* Use dvh (dynamic viewport height) for better mobile support */
:root {
  --vh: 1vh; /* fallback */
  --dvh: 1dvh; /* modern mobile support */
}

/* Mobile-specific body and html setup - ONLY for calendar pages, not about page */
@media (pointer: coarse) {
  html:not([data-page="about"]), 
  body:not([data-page="about"]) {
    height: 100%;
    height: 100dvh; /* Use dynamic viewport height on mobile */
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevent any scrolling on mobile */
    position: fixed; /* Lock viewport on mobile */
    width: 100%;
  }
  
  body:not([data-page="about"]) {
    display: flex;
    flex-direction: column;
  }
}

/* Header and footer sizing for mobile */
@media (pointer: coarse) {
  .one-line-header, footer {
    flex-shrink: 0;
    height: auto;
    min-height: 50px; /* Ensure consistent minimum height */
  }
  
  .calendar-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    height: calc(100dvh - 100px); /* Account for header + footer */
    min-height: 0;
  }
}

/* Portrait mobile fixes */
@media (pointer: coarse) and (orientation: portrait) {
  .calendar-container {
    flex: 1;
    overflow: hidden;
  }
  
  #calendar-img {
    width: auto;
    height: 100%;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
  }
  
  .calendar-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Landscape mobile fixes */
@media (pointer: coarse) and (orientation: landscape) {
  .one-line-header, footer {
    min-height: 28px; /* Even smaller header/footer height */
    padding: 2px 8px; /* Minimal padding */
  }
  
  /* Make header elements more compact */
  .one-line-header .site-logo {
    height: 22px; /* Much smaller logo */
  }
  
  .one-line-header .title-text {
    font-size: 0.95rem !important; /* Even smaller title text */
    line-height: 0.9 !important;
  }
  
  .one-line-header .brand-group {
    gap: 4px; /* Minimal gap between logo and title */
  }
  
  /* Make kebab button much smaller */
  .kebab-btn {
    width: 26px !important;
    height: 26px !important;
  }
  
  .kebab-btn i {
    font-size: 12px !important;
  }
  
  .calendar-container {
    height: calc(100dvh - 56px); /* Adjust for even smaller header/footer */
  }
  
  #calendar-img {
    width: auto;
    height: calc(100dvh - 56px);
    max-width: 100vw;
    max-height: calc(100dvh - 56px);
    object-fit: contain;
    display: block;
  }
  
  .calendar-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Prevent any scrolling issues in landscape */
  body {
    overflow: hidden !important;
  }
  
  /* Ensure footer stays visible */
  footer {
    position: relative;
    z-index: 10;
  }
}

/* Mobile zoom image fixes */
@media (pointer: coarse) {
  .nmzoom-img {
    max-width: 85vw !important;
    max-height: 70vh !important;
    max-height: 70dvh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
  }
}

/* Landscape zoom specific fixes */
@media (pointer: coarse) and (orientation: landscape) {
  .nmzoom-img {
    max-width: 80vw !important;
    max-height: 60vh !important;
    max-height: 60dvh !important;
  }
}

/* Override existing landscape mobile styles that might cause issues */
@media (orientation: landscape) and (pointer: coarse) {
  html, body {
    height: 100dvh !important;
    overflow: hidden !important;
  }
  
  .calendar-container {
    min-height: calc(100dvh - 56px) !important;
    max-height: calc(100dvh - 56px) !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
  }
  
  .calendar-wrapper {
    overflow: hidden !important;
  }
  
  /* Disable the problematic active scaling */
  .clickable-box:active img {
    transform: scale(1) !important;
  }
  
  /* Ensure proper footer positioning */
  footer {
    position: relative !important;
    flex-shrink: 0 !important;
    height: auto !important;
    min-height: 28px !important;
  }
}

/* Fallback for browsers that don't support dvh */
@supports not (height: 100dvh) {
  @media (pointer: coarse) {
    html, body {
      height: 100vh;
    }
    
    .calendar-container {
      height: calc(100vh - 100px);
    }
    
    #calendar-img {
      max-height: calc(100vh - 120px);
    }
  }
  
  @media (pointer: coarse) and (orientation: landscape) {
    .calendar-container {
      height: calc(100vh - 56px);
    }
    
    #calendar-img {
      height: calc(100vh - 56px);
      max-height: calc(100vh - 56px);
    }
  }
}


/* === FINAL: Mobile landscape fit (no scroll) — footer clip fix (2025-08-13) === */
@media (orientation: landscape) and (pointer: coarse) {
  html, body {
    height: 100dvh !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }
  header, footer { 
    flex: 0 0 auto !important; 
    min-height: 28px !important;
  }
  .calendar-container {
    flex: 1 1 0 !important; /* Use flex-basis 0 for better space distribution */
    min-height: 0 !important; /* Allow shrinking */
    overflow: hidden !important;
    padding: 0 !important;
  }
  .calendar-wrapper { height: 100% !important; }
  #calendar-img {
    display: block !important;
    height: 100% !important;
    width: auto !important;
    max-width: 100vw !important;
    max-height: 100% !important;
    object-fit: contain !important;
    margin: 0 auto !important;
  }
}
