﻿/*
Theme Name: Anirrban
Theme URI: https://anirrban.com
Author: Anirrban Batacharrya
Description: A dark gallery theme for photographs and life thoughts. Every section is an ACF component the client edits from wp-admin.
Version: 1.0.1
Requires at least: 6.5
Requires PHP: 8.0
Text Domain: anirrban
*/

/* ============================================================
   base — a dark gallery
   Full-bleed opening image, an editorial grid of large photographs,
   then essays set at reading scale. The work is the hero; the chrome
   stays out of the way.
   ============================================================ */
[hidden] { display: none !important; }
img { max-width: 100%; }

:root {
  --bg: #0D0E10;          /* gallery wall */
  --bg-2: #15171A;        /* raised panel */
  --fg: #ECE8E1;          /* warm paper white */
  --fg-soft: #A29D95;     /* caption grey */
  --rule: #2A2C30;
  --accent: #7DB2E2;      /* Vector blue, lifted for a dark wall */
  --display: "Bodoni Moda", "Didot", "Bodoni 72", "Times New Roman", serif;
  --body: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 18px; line-height: 1.65; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1320px; margin: 0 auto; }
.label { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-soft); }
.num { font-variant-numeric: tabular-nums; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ---------- header ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
.top { position: absolute; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 22px; }
.top .brand { display: block; width: 76px; color: var(--fg); }
.top .brand svg { width: 100%; height: auto; display: block; }
.top .brand img { width: 100%; height: auto; display: block; }
.top nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(16px, 3vw, 36px); flex-wrap: wrap; }
.top nav a { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; color: var(--fg); opacity: .85; }
.top nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--accent); }
.top nav a[aria-current="page"] { opacity: 1; text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--accent); }

/* The hamburger: three hairlines, and the same button becomes the cross that closes
   the panel. It only exists below the tablet breakpoint. */
.menu-toggle { all: unset; display: none; cursor: pointer; width: 40px; height: 40px; place-content: center; gap: 6px; position: relative; z-index: 30; }
.menu-toggle span { display: block; width: 26px; height: 1px; background: var(--fg); transition: transform .22s ease, opacity .18s ease; }
.menu-toggle:hover span, .menu-toggle:focus-visible span { background: var(--accent); }
.nav-head { display: none; }

@media (max-width: 900px) {
  .menu-toggle { display: grid; }

  /* Once the script is running the nav becomes a full-screen panel; without it the
     links stay where they are, in a wrapped row, so the menu is never unreachable. */
  .has-js .top nav {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: none;
    flex-direction: column;
    padding: calc(28px + env(safe-area-inset-top, 0px)) 24px calc(40px + env(safe-area-inset-bottom, 0px));
    background: var(--bg);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .has-js .top nav.is-open { display: flex; }

  .has-js .nav-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 20px;
  }
  .has-js .nav-close { all: unset; cursor: pointer; font-family: var(--mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg); padding: 6px 0; }
  .has-js .nav-close:hover { color: var(--accent); }

  /* Open, the panel carries the one close control; the hamburger steps out of the way
     so there are never two crosses on screen. */
  .menu-toggle[aria-expanded="true"] { display: none; }

  .has-js .top nav ul { flex-direction: column; gap: 0; width: 100%; margin-top: 4px; }
  .has-js .top nav li { border-top: 1px solid var(--rule); }
  .has-js .top nav li:last-child { border-bottom: 1px solid var(--rule); }
  .has-js .top nav a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 0;
    font-family: var(--display);
    font-size: 30px;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    opacity: 1;
  }
  .has-js .top nav a::after { content: "→"; font-family: var(--mono); font-size: 12px; color: var(--fg-soft); }
  .has-js .top nav a:hover { color: var(--accent); text-decoration: none; }
  .has-js .top nav a:hover::after { color: var(--accent); }
  .has-js .top nav a[aria-current="page"] { color: var(--accent); text-decoration: none; }

  body.nav-open { overflow: hidden; }

  /* The admin bar sits on top of the page for a logged-in editor, so the panel starts
     below it rather than under it. */
  body.admin-bar .has-js .top nav { padding-top: calc(60px + env(safe-area-inset-top, 0px)); }

  /* the hamburger never lingers while the panel is open, so no cross-to-cross overlap */
}
@media (min-width: 901px) { .nav-head { display: none; } }
@media (max-width: 782px) {
  body.admin-bar .has-js .top nav { padding-top: calc(74px + env(safe-area-inset-top, 0px)); }
}

/* ---------- opening ---------- */
.opening { position: relative; min-height: clamp(560px, 82vh, 860px); display: grid; align-items: end; overflow: hidden; isolation: isolate; }
.opening > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transform: scale(1.04); }
.opening::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(13,14,16,.55) 0%, rgba(13,14,16,.15) 35%, rgba(13,14,16,.65) 75%, var(--bg) 100%); }
.opening .wrap { width: 100%; padding-block: 140px clamp(48px, 8vw, 96px); display: grid; gap: 28px; }
.opening h1 { font-family: var(--display); font-weight: 400; font-size: clamp(48px, 9.2vw, 148px); line-height: .92; letter-spacing: -.02em; margin: 0; max-width: 11ch; text-wrap: balance; }
.opening h1 em { font-style: italic; color: var(--accent); }
.opening .sub { display: flex; flex-wrap: wrap; gap: 12px 40px; align-items: baseline; justify-content: space-between; border-top: 1px solid rgba(236,232,225,.25); padding-top: 18px; }
.opening .sub p { margin: 0; font-size: clamp(18px, 1.7vw, 22px); max-width: 46ch; color: var(--fg); }
.opening .credit { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-soft); }
/* a longer headline (inner pages) needs a second line of room */
.opening.is-inner h1 { font-size: clamp(40px, 6.4vw, 96px); max-width: 16ch; }

/* ---------- section heads ---------- */
section { padding-block: clamp(64px, 10vw, 140px); }
.head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 16px 32px; margin-bottom: clamp(32px, 5vw, 64px); }
.head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(40px, 6vw, 84px); line-height: .95; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
.head h2 em { font-style: italic; }
.head .label { text-align: right; }

/* ---------- selected work ---------- */
.works { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); }
.work { margin: 0; min-width: 0; }
.work.w7 { grid-column: span 7; } .work.w5 { grid-column: span 5; } .work.w4 { grid-column: span 4; }
.work button { all: unset; cursor: zoom-in; display: block; width: 100%; overflow: hidden; background: var(--bg-2); }
.work img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1), filter .5s ease; }
.work button:hover img, .work button:focus-visible img { transform: scale(1.03); }
.work.bw img { filter: grayscale(1) contrast(1.1); }
.work figcaption { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: baseline; padding-top: 12px; }
.work figcaption .t { font-family: var(--display); font-style: italic; font-size: 19px; }
.work figcaption .label { white-space: nowrap; }
.work.offset { margin-top: clamp(0px, 6vw, 88px); }
@media (prefers-reduced-motion: reduce) { .work img { transition: none; } }

/* ---------- thought ---------- */
.thought { border-block: 1px solid var(--rule); }
.thought blockquote { margin: 0 auto; max-width: 1100px; }
.thought blockquote p { font-family: var(--display); font-weight: 400; font-size: clamp(32px, 4.6vw, 64px); line-height: 1.12; letter-spacing: -.01em; margin: 0 0 28px; text-wrap: balance; }
.thought blockquote p::before { content: "\201C"; color: var(--accent); margin-right: .05em; }
.thought blockquote p::after { content: "\201D"; color: var(--accent); }
.thought cite { font-style: normal; display: flex; gap: 16px; align-items: center; }
.thought cite::before { content: ""; width: 48px; height: 1px; background: var(--accent); }

/* ---------- essays ---------- */
.feature-essay { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 64px); align-items: center; margin-bottom: clamp(48px, 6vw, 80px); text-decoration: none; }
.feature-essay img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; filter: grayscale(1) contrast(1.1); }
.feature-essay .copy { display: grid; gap: 18px; min-width: 0; }
.feature-essay h3 { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 4vw, 56px); line-height: 1.02; margin: 0; text-wrap: balance; }
.feature-essay p { margin: 0; color: var(--fg-soft); font-size: 19px; max-width: 44ch; }
.feature-essay .more { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.feature-essay:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 8px; text-decoration-color: var(--accent); }
.essays { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.essays li a { display: grid; grid-template-columns: 64px minmax(0, 1fr) 160px 90px; gap: 8px 24px; align-items: baseline; padding-block: 26px; border-bottom: 1px solid var(--rule); text-decoration: none; }
.essays .n { font-family: var(--mono); font-size: 12px; color: var(--fg-soft); }
.essays h4 { font-family: var(--display); font-weight: 400; font-size: clamp(24px, 2.6vw, 34px); line-height: 1.15; margin: 0; }
.essays li a:hover h4 { color: var(--accent); }
.essays .label:last-child { text-align: right; }

/* ---------- series ---------- */
.series { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); }
.series a { text-decoration: none; display: grid; gap: 14px; min-width: 0; }
.series img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; transition: filter .4s ease; }
.series a:hover img { filter: brightness(1.12); }
.series .bw img { filter: grayscale(1) contrast(1.1); }
.series h3 { font-family: var(--display); font-weight: 400; font-size: 30px; margin: 0; }
.series .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

/* ---------- about ---------- */
.about { background: var(--bg-2); }
.about .grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px); }
.about .statement { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 4.4vw, 62px); line-height: 1.06; margin: 0; text-wrap: balance; }
.about .statement em { font-style: italic; color: var(--accent); }
.about .bio { display: grid; gap: 22px; align-content: start; min-width: 0; }
.about .bio p { margin: 0; max-width: 52ch; }
.facts { margin: 8px 0 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.facts div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding-block: 14px; border-bottom: 1px solid var(--rule); }
.facts dt { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-soft); padding-top: 4px; }
.facts dd { margin: 0; }

/* ---------- letters ---------- */
.letters .box { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: end; }
.letters h2 { font-family: var(--display); font-weight: 400; font-size: clamp(36px, 4.6vw, 64px); line-height: 1; margin: 0 0 14px; }
.letters p { margin: 0; color: var(--fg-soft); max-width: 44ch; }
.letters form { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-bottom: 1px solid var(--fg); }
.letters input { all: unset; padding: 14px 0; font-family: var(--body); font-size: 20px; color: var(--fg); min-width: 0; }
.letters input::placeholder { color: var(--fg-soft); }
.letters button { all: unset; cursor: pointer; font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; padding: 14px 0 14px 20px; color: var(--accent); }
.letters .note { grid-column: 2; font-family: var(--mono); font-size: 12px; color: var(--accent); min-height: 1.4em; margin-top: 10px; }

/* ---------- footer ---------- */
footer .wrap { border-top: 1px solid var(--rule); padding-block: 40px 56px; display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 32px; align-items: center; }
footer .sig { color: var(--fg); width: 120px; }
footer .sig svg, footer .sig img { width: 100%; height: auto; display: block; }
/* No mark uploaded: the words take the space the logo would have had. */
footer.no-mark .wrap { grid-template-columns: minmax(0, 1fr) auto; }
footer p { margin: 0; color: var(--fg-soft); font-size: 15px; }
.foot-text { display: grid; gap: 8px; min-width: 0; }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot-links a {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-soft); text-decoration: none;
}
.foot-links a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- viewer ---------- */
.viewer { position: fixed; inset: 0; z-index: 60; background: rgba(5,6,7,.97); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.viewer[hidden] { display: none; }
.viewer .bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: max(16px, env(safe-area-inset-top, 0px)); padding-bottom: 12px; }
.viewer .stage { display: grid; place-items: center; min-height: 0; padding-block: 8px; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.viewer .cap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 14px; padding-bottom: max(20px, env(safe-area-inset-bottom, 0px)); }
.viewer .cap .t { font-family: var(--display); font-style: italic; font-size: 24px; }
.vbtn { all: unset; cursor: pointer; font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg); padding: 8px 2px; }
.vbtn:hover { color: var(--accent); }
.viewer .nav { display: flex; gap: 24px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .work.w7, .work.w5, .work.w4 { grid-column: span 12; }
  .work.offset { margin-top: 0; }
  .feature-essay, .about .grid, .letters .box { grid-template-columns: minmax(0, 1fr); }
  .letters .note { grid-column: 1; }
  .series { grid-template-columns: minmax(0, 1fr); }
  .series img { aspect-ratio: 3 / 2; }
  .essays li a { grid-template-columns: 44px minmax(0, 1fr); }
  .essays li a .label { grid-column: 2; text-align: left !important; }
  footer .wrap { grid-template-columns: minmax(0, 1fr); }
  .head { grid-template-columns: minmax(0, 1fr); }
  .head .label { text-align: left; }
}
@media (max-width: 520px) {
  .top .brand { width: 58px; }
  .top nav ul { gap: 14px; }
  .top nav a { font-size: 11px; letter-spacing: .12em; }
  .facts div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* ============================================================
   the WordPress layer — only what the templates need
   ============================================================ */

/* logged-in admin bar sits above the absolute header */
body.admin-bar .top { top: calc(32px + env(safe-area-inset-top, 0px)); }
@media (max-width: 782px) { body.admin-bar .top { top: calc(46px + env(safe-area-inset-top, 0px)); } }

/* the banner is the same block on every page; only its height changes */
.opening.is-short { min-height: clamp(420px, 62vh, 660px); }
.opening.is-short .wrap { padding-block: 120px clamp(36px, 6vw, 64px); }
.opening .sub .credit a { text-decoration: none; }

/* a ruled band of facts, under a banner: four columns, no buttons */
.facts-band { border-bottom: 1px solid var(--rule); padding-block: clamp(24px, 3.4vw, 40px); }
.facts-band .stack { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px clamp(20px, 3vw, 44px); }
.facts-band .stack > div { display: grid; gap: 6px; align-content: start; }
.facts-band b { font-family: var(--mono); font-weight: 500; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-soft); }
.facts-band span { font-size: 17px; }
@media (max-width: 900px) { .facts-band .stack { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .facts-band .stack { grid-template-columns: minmax(0, 1fr); } }

/* a section with its own ground */
.band { background: var(--bg-2); }
.band--rule { border-block: 1px solid var(--rule); background: none; }

/* rich text that the client writes in a WYSIWYG: styled by context, never by extra fields */
.prose-body > * { margin: 0; }
.prose-body > * + * { margin-top: 1.2em; }
.prose-body h2 { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 3vw, 42px); line-height: 1.12; letter-spacing: -.012em; margin-top: 1.9em; }
.prose-body h3 { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.2; margin-top: 1.6em; }
.prose-body ul, .prose-body ol { padding-left: 1.2em; }
.prose-body li + li { margin-top: .4em; }
.prose-body blockquote { margin: clamp(26px, 4vw, 44px) 0; padding-left: 18px; border-left: 1px solid var(--accent); }
.prose-body blockquote p { font-family: var(--display); font-size: clamp(22px, 2.6vw, 34px); line-height: 1.22; }
.prose-body a { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--accent); }
.prose-body figure { margin: clamp(28px, 4vw, 44px) 0; }
.prose-body figcaption, .prose-body .wp-element-caption { margin-top: 10px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-soft); }

/* buttons built from an ACF link field */
.btn { display: inline-block; font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; color: var(--fg); border: 1px solid var(--rule); padding: 13px 22px; transition: border-color .25s ease, color .25s ease; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn--accent { border-color: var(--accent); color: var(--accent); }
.btn--accent:hover { background: var(--accent); color: var(--bg); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(20px, 2.6vw, 30px); }

/* generic ACF layouts: a full-width image, a two-column split, three boxes, an FAQ, tabs */
.bleed-image { padding-block: 0; }
.bleed-image img { width: 100%; height: clamp(320px, 68vh, 720px); object-fit: cover; display: block; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: clamp(22px, 3vw, 44px); }
.boxes figure { margin: 0; display: grid; gap: 14px; align-content: start; }
.boxes img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding-block: 20px; font-family: var(--display); font-size: clamp(20px, 2.2vw, 28px); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; font-family: var(--mono); color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding-bottom: 22px; color: var(--fg-soft); max-width: 62ch; }
.tabs-nav { display: flex; flex-wrap: wrap; gap: 10px 26px; border-bottom: 1px solid var(--rule); margin-bottom: 26px; }
.tabs-nav button { all: unset; cursor: pointer; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-soft); padding-block: 12px; }
.tabs-nav button[aria-selected="true"] { color: var(--fg); box-shadow: inset 0 -1px 0 var(--accent); }

@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}
