/*
Theme Name: Andrew Chew Folio
Author: Andrew Chew
Description: A dark editorial photography theme built around Stories, Single frames, an Archive and a Lab, with a plain light layout for training pages.
Version: 1.0.3
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: andrewchew-folio
*/

/* ---------- Shared ---------- */
:root {
	--ac-ground: #0F0E0D;
	--ac-raised: #191715;
	--ac-text: #F1EDE6;
	--ac-soft: #D5CFC5;
	--ac-muted: #A39D93;
	--ac-line: #3A3632;
	--ac-accent: #FF6A3D;
	--ac-display: Archivo, "Arial Narrow", Arial, sans-serif;
	--ac-body: Inter, "Helvetica Neue", Arial, sans-serif;
	--ac-mono-font: "IBM Plex Mono", Menlo, Consolas, monospace;
	--ac-pad: clamp(20px, 5vw, 60px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; height: auto; }
.ac-skip { position: absolute; left: -9999px; top: 0; padding: 12px 16px; background: #fff; color: #000; z-index: 100; }
.ac-skip:focus { left: 8px; top: 8px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Photography site (dark) ---------- */
body.ac-dark { background: var(--ac-ground); color: var(--ac-text); font-family: var(--ac-body); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
.ac-dark a { color: var(--ac-text); }
.ac-dark a:hover { color: #fff; }
.ac-dark :focus-visible { outline: 2px solid var(--ac-accent); outline-offset: 3px; }
.ac-wrap { max-width: 1320px; margin-inline: auto; }
.ac-section { padding: clamp(64px, 9vw, 128px) var(--ac-pad); }
.ac-tight-top { padding-top: 0; }
.ac-no-top { padding-top: 0; }
.ac-page-top { padding-top: clamp(48px, 7vw, 96px); }
.ac-stack { display: flex; flex-direction: column; gap: 40px; }
.ac-display { font-family: var(--ac-display); font-stretch: 125%; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.ac-h1 { font-size: clamp(44px, 8vw, 112px); line-height: 0.95; text-wrap: balance; }
.ac-h2 { font-size: clamp(34px, 5vw, 68px); line-height: 1; }
.ac-mono { font-family: var(--ac-mono-font); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.ac-muted { color: var(--ac-muted); }
.ac-lede { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.5; max-width: 720px; margin: 0; text-wrap: pretty; }
.ac-lede > :first-child { margin-top: 0; }
.ac-lede > :last-child { margin-bottom: 0; }
.ac-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.ac-btn { display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 14px 28px; border-radius: 999px; background: var(--ac-accent); color: #0F0E0D !important; font-weight: 600; text-decoration: none; }
.ac-btn:hover { filter: brightness(1.08); }
.ac-btn.is-large { font-size: 18px; padding: 18px 32px; }
.ac-link { display: inline-flex; align-items: center; gap: 10px; padding: 12px 0; font-weight: 600; text-underline-offset: 6px; }

/* Navigation */
.ac-head { border-bottom: 1px solid #2C2926; }
.ac-nav { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; padding: 24px var(--ac-pad); }
.ac-brand { font-family: var(--ac-display); font-stretch: 125%; font-weight: 800; font-size: 18px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; padding: 10px 0; }
.ac-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 32px; font-size: 15px; font-weight: 500; }
.ac-links a { text-decoration: none; padding: 12px 0; }
.ac-links a:hover { text-decoration: underline; text-underline-offset: 8px; }
.ac-links .ac-pill { padding: 11px 20px; border: 1px solid rgba(241, 237, 230, 0.6); border-radius: 999px; }
.ac-links .ac-pill:hover { text-decoration: none; background: var(--ac-text); color: #0F0E0D; }
.ac-menu-btn { display: none; min-height: 44px; padding: 0 18px; border: 1px solid rgba(241, 237, 230, 0.6); border-radius: 999px; background: transparent; color: var(--ac-text); font: 500 14px var(--ac-body); cursor: pointer; }
@media (max-width: 760px) {
	.ac-menu-btn { display: inline-block; }
	.ac-links { display: none; flex-basis: 100%; flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 0 12px; }
	.ac-nav.is-open .ac-links { display: flex; }
	.ac-nav.on-hero.is-open { background: rgba(15, 14, 13, 0.92); }
	.ac-links a { padding: 13px 0; font-size: 17px; }
	.ac-links .ac-pill { margin-top: 8px; padding: 12px 22px; }
}

/* Home hero */
.ac-hero { position: relative; min-height: min(860px, 100svh); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; background: #171513; }
.ac-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.ac-hero-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15, 14, 13, 0.72) 0%, rgba(15, 14, 13, 0) 22%, rgba(15, 14, 13, 0) 40%, rgba(15, 14, 13, 0.9) 80%, #0F0E0D 100%); }
.ac-hero-body { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 40px; padding: 120px var(--ac-pad) 56px; }
.ac-hero-text { display: flex; flex-direction: column; gap: 24px; flex: 1 1 560px; max-width: 1000px; }
.ac-hero-caption { margin: 0; }
.ac-hero-title { font-size: clamp(34px, 7vw, 104px); line-height: 0.95; overflow-wrap: break-word; }
.ac-hero-sub { margin: 0; font-size: clamp(17px, 1.6vw, 21px); line-height: 1.5; max-width: 560px; }
.ac-now { display: flex; flex-direction: column; gap: 0; min-width: 240px; }
.ac-now > span { padding-bottom: 10px; }
.ac-now a { text-decoration: none; padding: 10px 0; border-top: 1px solid rgba(241, 237, 230, 0.35); }

/* Statement */
.ac-statement { display: flex; flex-wrap: wrap; gap: 48px 80px; align-items: flex-end; }
.ac-statement-text { margin: 0; flex: 3 1 520px; font-family: var(--ac-display); font-weight: 500; font-size: clamp(26px, 3.3vw, 46px); line-height: 1.18; letter-spacing: -0.01em; text-wrap: pretty; }
.ac-facts { margin: 0; flex: 1 1 260px; display: grid; grid-template-columns: auto 1fr; gap: 12px 24px; font-size: 15px; align-content: start; }
.ac-facts dt { font-size: 12px; letter-spacing: 0.08em; color: var(--ac-muted); padding-top: 3px; }
.ac-facts dd { margin: 0; }

/* Section heads, cards, grids */
.ac-section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; padding-top: 28px; border-top: 1px solid var(--ac-line); }
.ac-section-head.is-plain { padding-top: 0; border-top: 0; }
.ac-lead-row { display: flex; flex-wrap: wrap; gap: 40px 24px; align-items: flex-end; }
.ac-lead-row .is-lead { flex: 2 1 520px; }
.ac-lead-row .is-tall { flex: 1 1 300px; }
.ac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 40px 24px; }
.ac-card { min-width: 0; display: flex; flex-direction: column; gap: 16px; text-decoration: none; }
.ac-card img, .ac-card-blank { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; background: var(--ac-raised); transition: opacity 0.2s; }
.ac-card.is-tall img { aspect-ratio: 4 / 5; }
.ac-card:hover img { opacity: 0.86; }
.ac-card-text { display: flex; flex-direction: column; gap: 6px; }
.ac-card-title { font-family: var(--ac-display); font-weight: 700; font-size: 24px; line-height: 1.1; }
.ac-card.is-lead .ac-card-title { font-size: clamp(24px, 2.6vw, 36px); }
.ac-card .ac-mono { color: var(--ac-muted); }
.ac-card:hover .ac-card-title { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

/* Section index */
.ac-index-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 48px; }
.ac-index-intro { max-width: 460px; font-size: 17px; color: var(--ac-soft); }
.ac-index-intro p { margin: 0; }
.ac-chips { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; font-weight: 500; }
.ac-chip { padding: 12px 18px; border-radius: 999px; border: 1px solid #5A554E; text-decoration: none; }
.ac-chip.is-on { background: var(--ac-text); border-color: var(--ac-text); color: #0F0E0D !important; }
.ac-dark .navigation.pagination { padding-top: 16px; }
.ac-dark .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-dark .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 14px; border: 1px solid #5A554E; border-radius: 999px; text-decoration: none; font-size: 14px; }
.ac-dark .page-numbers.current { background: var(--ac-text); color: #0F0E0D; border-color: var(--ac-text); }

/* Story page */
.ac-story-head { padding-bottom: clamp(40px, 5vw, 64px); }
.ac-crumbs { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ac-crumbs a { color: var(--ac-muted); }
.ac-story-title { font-size: clamp(44px, 9.5vw, 140px); line-height: 0.92; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.ac-story-intro { display: flex; flex-wrap: wrap; gap: 32px 80px; align-items: flex-start; }
.ac-story-intro .ac-lede { flex: 2 1 480px; }
.ac-frames { display: flex; flex-direction: column; gap: clamp(28px, 4vw, 64px); }
.ac-row { display: flex; gap: 24px; align-items: flex-start; }
.ac-row.is-stagger { align-items: flex-end; }
.ac-row.is-portrait { max-width: 760px; margin-inline: auto; width: 100%; }
.ac-fig { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ac-fig img { width: 100%; height: auto; display: block; background: var(--ac-raised); }
.ac-zoom { display: block; cursor: zoom-in; }
.ac-fig figcaption { display: flex; justify-content: space-between; gap: 24px; color: var(--ac-muted); }
@media (max-width: 700px) {
	.ac-row { flex-direction: column; gap: 28px; }
	.ac-fig { flex: none !important; width: 100%; }
}
.ac-next { display: flex; flex-wrap: wrap; align-items: center; gap: 32px 56px; text-decoration: none; padding-top: 56px; border-top: 1px solid var(--ac-line); }
.ac-next img { flex: 1 1 360px; min-width: 0; max-width: 560px; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.ac-next-text { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.ac-next-title { font-size: clamp(34px, 5vw, 72px); line-height: 0.98; }

/* Light band (Single frames) */
.ac-light { background: var(--ac-text); color: #0F0E0D; }
.ac-dark .ac-light a { color: #0F0E0D; }
.ac-light .ac-fig figcaption, .ac-light .ac-index-intro { color: #45403A; }
.ac-light .ac-fig img { background: #DDD7CC; }
.ac-fill { min-height: 70vh; }

/* About */
.ac-about { display: flex; flex-wrap: wrap; gap: 48px 80px; align-items: flex-start; }
.ac-about-portrait { flex: 1 1 320px; max-width: 460px; }
.ac-about-portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.ac-about-text { flex: 2 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.ac-about-text p { margin: 0; }
.ac-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 24px; padding-top: 12px; }
.ac-panel { display: flex; flex-direction: column; gap: 12px; padding: 28px; background: var(--ac-raised); }
.ac-panel h3 { margin: 0; font-family: var(--ac-display); font-weight: 700; font-size: 26px; line-height: 1.15; }
.ac-panel p { font-size: 16px; color: var(--ac-soft); }
.ac-panel .ac-link { margin-top: auto; }

/* Contact */
.ac-contact { display: flex; flex-direction: column; gap: 36px; padding-top: 56px; border-top: 1px solid var(--ac-line); }
.ac-contact-title { max-width: 1100px; font-size: clamp(40px, 7vw, 104px); line-height: 0.98; text-wrap: balance; }
.ac-contact-page { display: flex; flex-wrap: wrap; gap: 48px 80px; align-items: flex-start; }
.ac-contact-page > .ac-stack { flex: 1 1 360px; gap: 24px; }
.ac-form-panel { flex: 1 1 420px; min-width: 0; padding: clamp(24px, 4vw, 40px); background: var(--ac-text); color: #0F0E0D; }
.ac-dark .ac-form-panel a { color: #0F0E0D; }
.ac-form-panel > :first-child { margin-top: 0; }
.ac-form-panel button[type="submit"], .ac-form-panel input[type="submit"] { min-height: 52px; padding: 14px 30px !important; border: 0 !important; border-radius: 999px !important; background: #0F0E0D !important; color: #F1EDE6 !important; font: 600 16px var(--ac-body) !important; cursor: pointer; }
.ac-form-panel button[type="submit"]:hover, .ac-form-panel input[type="submit"]:hover { background: #2C2926 !important; }

/* Written content on dark pages */
.ac-prose { max-width: 720px; }
.ac-prose > * { margin-block: 0 1.1em; }
.ac-prose > :last-child { margin-bottom: 0; }
.ac-prose h2, .ac-prose h3 { font-family: var(--ac-display); font-weight: 700; line-height: 1.15; margin-top: 1.6em; }
.ac-prose a { text-underline-offset: 4px; }
.ac-prose iframe, .ac-prose .wp-block-embed { max-width: 100%; }
.ac-prose .alignwide, .ac-prose .alignfull { max-width: none; }

/* Footer */
.ac-foot { padding: 28px var(--ac-pad) 40px; border-top: 1px solid #2C2926; }
.ac-foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; font-size: 14px; color: var(--ac-muted); }
.ac-foot-links { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.ac-foot-links a { padding: 12px 0; color: var(--ac-soft); }

/* Full-screen viewer */
.ac-viewer { position: fixed; inset: 0; z-index: 100000; display: none; flex-direction: column; background: rgba(8, 7, 7, 0.97); color: var(--ac-text); font-family: var(--ac-body); }
.ac-viewer.is-open { display: flex; }
.ac-viewer-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ac-viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ac-viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px 20px; }
.ac-viewer-caption { font-family: var(--ac-mono-font); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ac-muted); white-space: pre-wrap; }
.ac-viewer-btns { display: flex; gap: 8px; }
.ac-viewer button { min-width: 48px; min-height: 48px; padding: 0 16px; border: 1px solid rgba(241, 237, 230, 0.5); border-radius: 999px; background: transparent; color: var(--ac-text); font: 500 14px var(--ac-body); cursor: pointer; }
.ac-viewer button:hover { background: var(--ac-text); color: #0F0E0D; }

/* ---------- Plain light layout (training pages and posts) ---------- */
body.ac-plain {
	--ast-global-color-0: #046bd2; --ast-global-color-1: #045cb4; --ast-global-color-2: #1e293b;
	--ast-global-color-3: #334155; --ast-global-color-4: #F0F5FA; --ast-global-color-5: #FFFFFF;
	--ast-global-color-6: #D1D5DB; --ast-global-color-7: #111111; --ast-global-color-8: #111111;
	background: #fff; color: #334155; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 16px; line-height: 1.65;
}
.ac-plain a { color: #046bd2; }
.ac-plain a:hover { color: #045cb4; }
.ac-plain h1, .ac-plain h2, .ac-plain h3, .ac-plain h4, .ac-plain h5, .ac-plain h6 { color: #1e293b; font-weight: 600; line-height: 1.3; }
.ac-plain h1 { font-size: 2.25rem; } .ac-plain h2 { font-size: 1.875rem; } .ac-plain h3 { font-size: 1.5rem; } .ac-plain h4 { font-size: 1.25rem; }
.plain-wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }
.plain-head { border-bottom: 1px solid #E5E7EB; padding: 18px 0; }
.plain-head a { color: #1e293b; font-weight: 700; font-size: 20px; text-decoration: none; }
.plain-main { padding: 40px 0 64px; }
.plain-title { font-size: 1.75rem !important; margin: 0 0 24px; }
.plain-content > * { width: min(1200px, 100% - 40px); margin-inline: auto; }
.plain-content > .alignfull { width: 100%; max-width: none; }
.plain-content > .alignwide { width: min(1400px, 100% - 40px); }
.plain-content > p, .plain-content > ul, .plain-content > ol, .plain-content > h1, .plain-content > h2, .plain-content > h3, .plain-content > h4 { margin-block: 0 1.2em; }
.plain-content img { height: auto; }
.ac-plain .wp-block-button__link { background: #046bd2; color: #fff; }
.ac-plain .wp-block-button__link:hover { background: #045cb4; color: #fff; }
.plain-list { padding-left: 1.2em; }
.plain-list li { margin-bottom: 0.5em; }
.plain-foot { border-top: 1px solid #E5E7EB; padding: 20px 0 28px; font-size: 14px; color: #64748B; }
