/*
Theme Name: The Flicks 2026
Theme URI: https://theflicks.ramonstoppelenburg.com
Description: The white screen, the dark blue curtains. Custom theme for The Flicks Community Movie Theater, Phnom Penh.
Author: Ramon Stoppelenburg
Author URI: https://www.hereigoagainonmyown.com
Version: 2.0.0
License: GNU General Public License v2.0
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: custom, cinema, movie-theater, responsive
Text Domain: theflicks
*/

/* ============================================================
   CSS VARIABLES
============================================================ */
:root {
  --navy-deepest: #081428;
  --navy-deep:    #0B1D3A;
  --navy:         #142B54;
  --navy-fold:    #1E3A6E;
  --navy-ink:     #10243F;   /* body text on white */
  --navy-soft:    #43597C;   /* muted text */
  --screen:       #FFFFFF;
  --screen-warm:  #FCFCFA;
  --rule:         #D8DEE9;

  --font-display: 'Limelight', cursive;
  --font-body:    'Archivo', sans-serif;

  --curtain-w: clamp(20px, 12vw, 170px);
  --valance-h: 56px;
  --content-w: 820px;
  --wide-w:    1020px;
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--navy-ink);
  background: var(--navy-deepest);
}

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

a { color: var(--navy); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--navy-fold); }

:focus-visible { outline: 3px solid var(--navy-fold); outline-offset: 2px; }

/* ============================================================
   THE CURTAINS — fixed, dark blue velvet folds
============================================================ */
.curtain {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 50vw;
  z-index: 20;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 18%, rgba(0,0,0,0.25) 100%),
    repeating-linear-gradient(90deg,
      var(--navy-deep)  0px,
      var(--navy)       16px,
      var(--navy-fold)  30px,
      var(--navy)       44px,
      var(--navy-deep)  58px
    );
  pointer-events: none;
}

.curtain--left  { left: 0;  box-shadow: 6px 0 22px rgba(8, 20, 40, 0.45); }
.curtain--right { right: 0; box-shadow: -6px 0 22px rgba(8, 20, 40, 0.45); }

.curtain--left  { transform: translateX(calc(-50vw + var(--curtain-w))); }
.curtain--right { transform: translateX(calc(50vw - var(--curtain-w))); }

@keyframes pull-left  { from { transform: translateX(0); } to { transform: translateX(calc(-50vw + var(--curtain-w))); } }
@keyframes pull-right { from { transform: translateX(0); } to { transform: translateX(calc(50vw - var(--curtain-w))); } }

/* Opening night: the slow reveal, front page only */
@media (prefers-reduced-motion: no-preference) {
  body.home .curtain--left,
  body.page-template-front .curtain--left  { animation: pull-left  4s cubic-bezier(0.4, 0.1, 0.25, 1) both; animation-delay: 0.8s; }
  body.home .curtain--right,
  body.page-template-front .curtain--right { animation: pull-right 4s cubic-bezier(0.4, 0.1, 0.25, 1) both; animation-delay: 0.8s; }
}

/* ============================================================
   THE VALANCE — scalloped pelmet across the top
============================================================ */
.valance {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--valance-h);
  z-index: 30;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.3), rgba(0,0,0,0) 60%),
    repeating-linear-gradient(90deg,
      var(--navy-deep)  0px,
      var(--navy)       14px,
      var(--navy-fold)  26px,
      var(--navy)       38px,
      var(--navy-deep)  50px
    );
  pointer-events: none;
}
.valance::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: -14px;
  height: 14px;
  background: radial-gradient(circle at 25px -4px, var(--navy) 22px, transparent 23px);
  background-size: 50px 14px;
  background-repeat: repeat-x;
  filter: drop-shadow(0 4px 6px rgba(8, 20, 40, 0.35));
}

/* Sticky white logo + menu on the valance, appears on scroll */
.valance-logo {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--valance-h);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 calc(var(--curtain-w) + clamp(20px, 4vw, 48px));
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}
.valance-logo.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.valance-logo .valance-home {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 8px 0;
}
.valance-logo img {
  height: calc(var(--valance-h) - 18px);
  width: auto;
  filter: brightness(0) invert(1); /* renders the transparent logo in pure white */
}
.valance-nav ul { list-style: none; display: flex; gap: 26px; }
.valance-nav a {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  opacity: 0.85;
}
.valance-nav a:hover { opacity: 1; color: #fff; text-decoration: underline; text-underline-offset: 4px; }

/* ============================================================
   THE SCREEN — everything lives here
============================================================ */
#pagewrap {
  position: relative;
  z-index: 10;
  margin: 0 var(--curtain-w);
  background: radial-gradient(ellipse 120% 60% at 50% 0%, var(--screen) 0%, var(--screen-warm) 100%);
  min-height: 100vh;
  padding: calc(var(--valance-h) + 24px) clamp(20px, 5vw, 64px) 0;
}

.inner  { max-width: var(--content-w); margin: 0 auto; }
.inner-wide { max-width: var(--wide-w); margin: 0 auto; }

/* ============================================================
   SITE HEADER & NAVIGATION (on the screen, below the valance)
============================================================ */
#header {
  max-width: var(--wide-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0 18px;
  border-bottom: 1px solid var(--rule);
}

#site-logo img,
#site-logo .custom-logo {
  max-height: 58px;
  width: auto;
  display: block;
}
#site-logo a { text-decoration: none; }
.site-title-text {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--navy);
  line-height: 1;
}
.site-tagline {
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--navy-soft);
}

#site-navigation ul {
  list-style: none;
  display: flex;
  gap: 30px;
}
#site-navigation a {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
#site-navigation a:hover,
#site-navigation .current-menu-item > a,
#site-navigation .current_page_item > a {
  border-bottom-color: var(--navy);
}

/* Hamburger */
#menu-icon {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}
#menu-icon span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
#menu-icon.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#menu-icon.open span:nth-child(2) { opacity: 0; }
#menu-icon.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   TYPE
============================================================ */
h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--navy);
  line-height: 1.15;
}
h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin-bottom: 0.5em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-bottom: 0.6em; }
h3, h4 {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.35em;
}
h3 { font-size: 1.05rem; }
h4 { font-size: 0.95rem; }

.eyebrow, .section-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--navy-soft);
  margin-bottom: 1.1em;
}

p { margin-bottom: 1.2em; }
p:last-child { margin-bottom: 0; }

.center { text-align: center; }

/* ============================================================
   HERO — the title card (front page)
============================================================ */
.hero {
  text-align: center;
  padding: clamp(30px, 6vh, 70px) 0 clamp(50px, 8vh, 90px);
}
.hero .logo {
  width: min(420px, 80%);
  margin: 0 auto 34px;
  display: block;
}
.hero .tagline {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--navy-ink);
  max-width: 760px;
  margin: 0 auto 12px;
}
.hero .subline {
  color: var(--navy-soft);
  font-size: 0.95rem;
  margin-bottom: 40px;
}

.hero .location-img {
  width: min(800px, 100%);
  display: block;
  margin: 10px auto 38px;
  border: 1px solid var(--rule);
}

/* Ticket buttons */
.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  padding: 15px 32px;
  margin: 0 8px 12px;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, transform 0.15s ease;
}
.btn--full {
  background: var(--navy);
  color: #fff;
  -webkit-mask: radial-gradient(circle 6px at 0 50%, transparent 97%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 6px at 100% 50%, transparent 97%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 6px at 0 50%, transparent 97%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 6px at 100% 50%, transparent 97%, #000) right / 51% 100% no-repeat;
}
.btn--full:hover { background: var(--navy-deep); color: #fff; transform: translateY(-1px); }
.btn--outline { border: 2px solid var(--navy); color: var(--navy); }
.btn--outline:hover { background: var(--navy); color: #fff; }

/* ============================================================
   FRONT PAGE SECTIONS
============================================================ */
.front-section {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: clamp(44px, 7vh, 76px) 0;
  border-top: 1px solid var(--rule);
}

/* End-credits style stats */
.credits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 28px 20px;
  text-align: center;
  margin-top: 40px;
}
.credits .num {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--navy);
  display: block;
  line-height: 1;
  margin-bottom: 8px;
}
.credits .label {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy-soft);
}

/* Program cards */
.program {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.program li {
  border: 1px solid var(--rule);
  padding: 20px 22px;
  background: #fff;
}
.program li strong { display: block; color: var(--navy); margin-bottom: 4px; }
.program li strong sup { font-size: 0.55em; letter-spacing: 0.05em; }
.program li span { font-size: 0.92rem; color: var(--navy-soft); line-height: 1.55; display: block; }

/* ============================================================
   MOVIE GRID (index / archive / front page)
============================================================ */
.films-header {
  max-width: var(--wide-w);
  margin: 0 auto;
  padding: clamp(44px, 7vh, 76px) 0 8px;
  border-top: 1px solid var(--rule);
  text-align: center;
}
body.paged .films-header,
body.archive .films-header,
body.search .films-header { border-top: none; padding-top: 40px; }

.loops-wrapper {
  max-width: var(--wide-w);
  margin: 32px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, 307px);
  justify-content: center;
  gap: 34px 26px;
}

.post {
  background: #fff;
  border: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(16, 36, 63, 0.12);
}
.post-thumbnail { display: block; line-height: 0; }
.post-thumbnail img { width: 100%; height: auto; aspect-ratio: 307 / 463; object-fit: cover; }

.post-content { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.post-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.25;
  margin-bottom: 8px;
}
.post-title a { color: var(--navy); text-decoration: none; }
.post-title a:hover { color: var(--navy-fold); }
.post .entry-content { font-size: 0.9rem; color: var(--navy-soft); line-height: 1.6; }
.post .entry-content p { margin-bottom: 0; }
.more-link {
  margin-top: auto;
  padding-top: 14px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy);
  text-decoration: none;
}
.more-link:hover { text-decoration: underline; }

/* Pagination */
.pagination {
  max-width: var(--wide-w);
  margin: 48px auto 0;
  text-align: center;
  font-size: 0.92rem;
}
.pagination .page-numbers {
  display: inline-block;
  min-width: 38px;
  padding: 8px 10px;
  margin: 0 3px;
  border: 1px solid var(--rule);
  color: var(--navy);
  text-decoration: none;
  background: #fff;
}
.pagination .page-numbers.current {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.pagination a.page-numbers:hover { border-color: var(--navy); }

.no-posts { text-align: center; color: var(--navy-soft); padding: 40px 0; }

/* ============================================================
   SINGLE POST (film pages) & PAGES
============================================================ */
.single-post-wrap,
.page-wrap {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: clamp(36px, 6vh, 64px) 0 0;
}
.single-post-wrap h1,
.page-wrap h1 { margin-bottom: 28px; }

.entry-content { font-size: 1rem; line-height: 1.85; }
.entry-content h2, .entry-content h3 { margin-top: 1.6em; }
.entry-content img { max-width: 100%; height: auto; }
.entry-content iframe { width: 100% !important; max-width: 100%; }
.entry-content .wp-block-embed { margin: 28px 0; }
.entry-content ul, .entry-content ol { margin: 0 0 1.2em 1.4em; }
.entry-content blockquote {
  border-left: 3px solid var(--navy);
  padding: 4px 0 4px 22px;
  margin: 1.4em 0;
  color: var(--navy-soft);
  font-style: italic;
}
.wp-caption, .wp-block-image figcaption {
  font-size: 0.82rem;
  color: var(--navy-soft);
  text-align: center;
}
.alignleft  { float: left;  margin: 6px 24px 12px 0; }
.alignright { float: right; margin: 6px 0 12px 24px; }
.aligncenter { display: block; margin: 12px auto; }

/* Prev/next film navigation */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
}
.post-nav-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--navy-soft);
  margin-bottom: 4px;
}

/* ============================================================
   SEARCH FORM
============================================================ */
.search-form { display: flex; gap: 10px; max-width: 460px; }
.search-field {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--navy-ink);
}
.search-field:focus { border-color: var(--navy); outline: none; }
.search-submit {
  padding: 12px 22px;
  background: var(--navy);
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.search-submit:hover { background: var(--navy-deep); }

/* ============================================================
   FOOTER (inside the screen)
============================================================ */
#footerwrap {
  max-width: var(--wide-w);
  margin: clamp(50px, 8vh, 80px) auto 0;
  border-top: 1px solid var(--rule);
  padding: 44px 0 60px;
  font-size: 0.88rem;
  color: var(--navy-soft);
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 36px;
  margin-bottom: 40px;
}
.footer-col h4 {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 14px;
}
.footer-col img { max-width: 200px; margin-bottom: 12px; }
.footer-col a { color: var(--navy-soft); }
.footer-col a:hover { color: var(--navy); }
.footer-nav-list { list-style: none; }
.footer-nav-list li { margin-bottom: 8px; }
address { font-style: normal; }

.footer-bottom {
  text-align: center;
  border-top: 1px solid var(--rule);
  padding-top: 32px;
}
.footer-bottom .fin {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--navy);
  display: block;
  margin-bottom: 20px;
}
.footer-bottom a { color: var(--navy-soft); }
.footer-bottom a:hover { color: var(--navy); }
.footer-sister-sites { margin-top: 14px; }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 860px) {
  .valance-nav { display: none; }
  .valance-logo { justify-content: center; padding: 0 var(--curtain-w); }
  #menu-icon { display: flex; }
  #site-navigation {
    display: none;
    position: absolute;
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 14px 24px rgba(16, 36, 63, 0.1);
    z-index: 15;
  }
  #site-navigation.open { display: block; }
  #site-navigation ul { flex-direction: column; gap: 0; padding: 10px 0; }
  #site-navigation li { border-bottom: 1px solid var(--rule); }
  #site-navigation li:last-child { border-bottom: none; }
  #site-navigation a { display: block; padding: 14px 24px; border-bottom: none; }
  #header { position: relative; }
}

@media (max-width: 640px) {
  :root { --curtain-w: 14px; --valance-h: 40px; }
  body { font-size: 16px; }
  .hero .btn { display: block; margin: 0 0 12px; }
  .post-nav { flex-direction: column; }
}