/*
 * site.css - one-page redesign, layered on top of w3.css
 * Modified by JK Benedict
 *
 * Uses "logical" properties (margin-inline-start, etc.) so the whole page
 * mirrors correctly when a right-to-left language is chosen.
 */

:root {
    --bar-h: 56px;
    --ink: #222;
    --muted: #666;
    --paper: #fff;
    --alt: #f6f2ee;
    --accent: #b5603f;          /* terra cotta */
    --accent-dark: #8e4429;
    --line: #e4ddd6;
    --radius: 6px;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 8px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body, h1, h2, h3, h4, h5, h6 { font-family: "Lato", sans-serif; }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.7; }
img { max-width: 100%; height: auto; display: block; }
/* Discourage saving pictures: no long-press menu (iPhone), no drag, no selecting */
img, .pf-thumb, .pf-zoom-stage {
    -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: .5em;
    padding: .65em 1.3em; border: 0; border-radius: var(--radius);
    background: var(--accent); color: #fff; font: inherit; font-weight: 700;
    letter-spacing: .04em; text-decoration: none; cursor: pointer;
}
.btn:hover, .btn:focus-visible { background: var(--accent-dark); color: #fff; }
.btn-light { background: #eee; color: var(--ink); }
.btn-light:hover, .btn-light:focus-visible { background: #ddd; color: var(--ink); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Top bar ---------- */
.topbar {
    position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 50;
    background: rgba(255,255,255,.97); border-block-end: 1px solid var(--line);
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
}
.topbar-inner {
    display: flex; align-items: center; gap: .75rem;
    height: var(--bar-h); padding-inline: 12px; max-width: 1200px; margin-inline: auto;
}
.hamburger {
    flex: none; width: 44px; height: 44px; border: 0; border-radius: var(--radius);
    background: transparent; font-size: 22px; cursor: pointer; color: var(--ink);
}
.hamburger:hover, .hamburger[aria-expanded="true"] { background: var(--alt); }
.brand {
    flex: none; font-weight: 700; letter-spacing: .18em; text-decoration: none;
    color: var(--ink); white-space: nowrap; font-size: 15px;
}
.inline-nav { display: flex; gap: .25rem; margin-inline-start: auto; }
.inline-nav a, .menu-panel a {
    color: var(--muted); text-decoration: none; font-weight: 400;
    padding: .4em .7em; border-radius: var(--radius);
}
.inline-nav a:hover, .menu-panel a:hover { color: var(--ink); background: var(--alt); }
/* Requirement 4: the selected anchor is BOLD */
.inline-nav a.is-active, .menu-panel a.is-active { font-weight: 700; color: var(--ink); }
.inline-nav a.is-active { box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }

.current-label { display: none; font-weight: 700; margin-inline-start: auto; }
.lang select {
    font: inherit; font-size: 14px; padding: .25em .3em; border: 1px solid var(--line);
    border-radius: var(--radius); background: #fff;
}

.menu-panel {
    /* Line up under the hamburger: the bar's content is centred at max 1200px
       with 12px padding, so on wide screens shift by the same margin. */
    position: absolute; inset-block-start: var(--bar-h);
    inset-inline-start: max(8px, calc((100% - 1200px) / 2 + 8px));
    min-width: 230px; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 6px; display: flex; flex-direction: column;
}
.menu-panel[hidden] { display: none; }
.menu-panel a { padding: .7em .9em; font-size: 16px; }
.menu-panel a i { color: var(--accent); margin-inline-end: .4em; }

@media (max-width: 900px) {
    .inline-nav { display: none; }
    .current-label { display: inline; }
}
@media (max-width: 420px) {
    .brand-sub { display: none; }
}

/* ---------- Sections ---------- */
main { padding-block-start: var(--bar-h); }
.section { padding: 64px 16px; }
.section.alt { background: var(--alt); }
.section-title { text-align: center; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 32px; font-size: 26px; }

.hero {
    min-height: calc(100vh - var(--bar-h)); min-height: calc(100svh - var(--bar-h));
    display: grid; place-items: center; text-align: center; padding: 32px 16px;
    background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.35)), url("../images/placeholders/hero.jpg") center / cover no-repeat, #6b5a50;
    color: #fff;
}
.hero h1 { letter-spacing: .3em; font-size: clamp(26px, 6vw, 54px); margin: 0 0 .3em; }
.hero p { font-size: clamp(16px, 2.5vw, 20px); margin: 0 0 1.5em; }

/* Two columns that stack on phones */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; gap: 20px; } }

/* About */
.photo { margin: 0; }
.photo img { border-radius: var(--radius); width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.photo-caption { text-align: center; margin-top: 10px; font-weight: 700; }
.photo-caption .fa { color: var(--accent); margin-inline-end: .35em; }
.photo-caption a { color: var(--accent); }
.photo-caption a:hover { color: var(--accent-dark); }
.text-box { text-align: start; align-self: start; }
.text-box h2 { margin-top: 0; letter-spacing: .12em; text-transform: uppercase; }
.about-text p:first-child { margin-top: 0; }
.dad-joke {
    margin-top: 24px; padding: 16px 20px; background: #f3ebdd;   /* light beige */
    border: 1px solid #e6dac4; border-radius: var(--radius);
}
.dad-joke h3 { margin: 0; font-size: 20px; letter-spacing: .04em; }
.dad-joke p { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid #e6dac4; }

/* Festivals */
.show-row { padding-block: 24px; border-block-end: 1px solid var(--line); }
.show-row:last-child { border-block-end: 0; }
.event-box { background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--accent); border-radius: var(--radius); padding: 20px; }
.event-box h3 { margin: 0 0 .5em; }
.event-box dl { display: grid; grid-template-columns: auto 1fr; gap: .3em 1em; margin: 0; }
.event-box dt { font-weight: 700; color: var(--muted); }
.event-box dd { margin: 0; }
.show-row img { border-radius: var(--radius); margin-top: 12px; }

/* Commissions */
.commissions { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
@media (max-width: 700px) { .commissions { grid-template-columns: 1fr; } }
.price-list table { width: 100%; border-collapse: collapse; }
.price-list th, .price-list td { padding: .6em .5em; border-block-end: 1px solid var(--line); text-align: start; }
.price-list td:last-child, .price-list th:last-child { text-align: end; font-weight: 700; white-space: nowrap; }
.price-list a { color: var(--ink); }
.price-list .unless { font-weight: 400; color: var(--muted); }
.price-list a.inquire-link { color: var(--accent); letter-spacing: .03em; }
.price-list a.inquire-link:hover { color: var(--accent-dark); }
.price-list .disclaimer { color: var(--ink); line-height: 1.5; }
.price-list .disclaimer i { padding-inline-end: .2em; }
.note { color: var(--muted); font-size: 14px; }
.item { padding-block-end: 20px; margin-block-end: 20px; border-block-end: 1px solid var(--line); }
.item:last-child { border-block-end: 0; }
.item h3 { margin: 0 0 .2em; }
.item p { margin: 0 0 .6em; }
.example { display: flex; gap: 12px; align-items: center; font-size: 14px; color: var(--muted); background: var(--alt); padding: 8px; border-radius: var(--radius); }
.example img { width: 72px; height: 72px; object-fit: cover; border-radius: 4px; flex: none; }

/* Portfolio band */
.portfolio-preview .sample { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.portfolio-preview .sample img { transition: opacity .2s; }
.portfolio-preview .sample:hover img, .portfolio-preview .sample:focus-visible img { opacity: .85; }
.portfolio-preview .lead { font-size: inherit; margin: 0 0 20px; }   /* v46: same size as other section text (e.g. the Festivals intro) */
/* Once the two columns stack (phones), center the "Browse previous works" button */
@media (max-width: 700px) { .portfolio-preview .text-box > .btn { display: table; margin-left: auto; margin-right: auto; } }

/* Contact form */
.inquiry { max-width: 640px; margin-inline: auto; display: grid; gap: 14px; }
.inquiry label { display: grid; gap: 4px; align-content: start; font-weight: 700; font-size: 15px; }
.inquiry input[type=text], .inquiry input[type=tel], .inquiry input[type=email], .inquiry textarea {
    font: inherit; font-weight: 400; padding: .6em .7em; border: 1px solid #ccc; border-radius: var(--radius); width: 100%; box-sizing: border-box;
}
.inquiry input:focus, .inquiry textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.inquiry input[type=file] { font: inherit; font-weight: 400; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.req { color: var(--accent); }
.hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.hp { position: absolute; inset-inline-start: -9999px; }
.file-list { list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--muted); }
.file-list li.bad { color: #b00020; }
.form-msg { margin: 0; min-height: 1.4em; font-weight: 700; }
.form-msg.error { color: #b00020; }
.lock-note { margin: 0; padding: .6em .8em; background: #fff4e5; border-radius: var(--radius); font-size: 14px; }
.inquiry progress { width: 100%; }
.receipt { max-width: 640px; margin-inline: auto; padding: 24px; border: 1px solid var(--line); border-inline-start: 4px solid #2e7d32; border-radius: var(--radius); }
.receipt h3 { margin-top: 0; color: #2e7d32; }
.receipt code { font-size: 15px; word-break: break-all; background: var(--alt); padding: .15em .4em; border-radius: 4px; }

/* Footer */
.site-footer { background: #1d1d1d; color: #ccc; text-align: center; padding: 48px 16px; }
.site-footer a { color: #fff; }
.site-footer .social { font-size: 34px; margin: 20px 0 8px; display: flex; justify-content: center; gap: 20px; }
.site-footer .social a:hover { opacity: .7; }
.site-footer p { margin: 0; line-height: 1.9; font-size: 14px; }

/* ---------- Portfolio modal ---------- */
body.modal-open { overflow: hidden; }
.pf-modal {
    position: fixed; inset: 0; z-index: 100; background: rgba(15,15,15,.96); color: #fff;
    display: flex; flex-direction: column;
}
.pf-modal[hidden] { display: none; }
.pf-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; }
.pf-head h2 { margin: 0; font-size: 20px; letter-spacing: .12em; text-transform: uppercase; }
.pf-close, .pf-nav {
    background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 50%;
    width: 44px; height: 44px; font-size: 18px; cursor: pointer; flex: none;
}
.pf-close:hover, .pf-nav:hover { background: rgba(255,255,255,.25); }
/* Thumbnail grid, like an album preview: square tiles, scrolls vertically */
.pf-grid-wrap {
    flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 16px 16px;
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.pf-grid {
    display: grid; gap: 6px; max-width: 1400px; margin: 0 auto;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.pf-thumb {
    display: block; position: relative; padding: 0; border: 0; background: #2a2a2a;
    cursor: zoom-in; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 4px;
}
.pf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s, opacity .25s; }
.pf-thumb:hover img, .pf-thumb:focus-visible img { transform: scale(1.04); opacity: .9; }
.pf-thumb:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pf-empty { text-align: center; color: #ccc; }
.pf-hint { text-align: center; color: #aaa; font-size: 14px; margin: 6px 0 14px; }
@media (max-width: 600px) {
    .pf-grid-wrap { padding: 2px 4px 10px; }
    .pf-grid { grid-template-columns: repeat(3, 1fr); gap: 3px; }
    .pf-thumb { border-radius: 2px; }
}
[dir="rtl"] .pf-nav i { transform: scaleX(-1); }

.pf-zoom { position: absolute; inset: 0; background: #000; display: flex; flex-direction: column; }
.pf-zoom[hidden] { display: none; }
.pf-zoom-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.pf-zoom-bar #pfCount { color: #ccc; font-size: 14px; }
.pf-min { margin-inline-start: auto; }
.pf-zoom-stage { flex: 1; overflow: auto; display: grid; place-items: center; cursor: zoom-in; touch-action: pan-x pan-y pinch-zoom; }
.pf-zoom-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pf-zoom-stage.zoomed { place-items: start; cursor: zoom-out; }
.pf-zoom-stage.zoomed img { max-width: none; max-height: none; width: 200%; }

/* Footer "Back to the top": black text; on press it turns dark gray with
   white text, holds briefly, then the page scrolls up (see site.js). */
.site-footer .btn-top { color: #000; }
.site-footer .btn-top:hover, .site-footer .btn-top:focus-visible { color: #000; }
.site-footer .btn-top:active,
.site-footer .btn-top.is-pressed { background: #444; color: #fff; }

/* Footer text: copyright line, then smaller credits + counts */
.site-footer p + p { margin-top: 12px; }
.site-footer p a { color: #ddd; text-decoration: underline; text-decoration-color: #666; text-underline-offset: 3px; }
.site-footer p a:hover { color: #fff; text-decoration-color: currentColor; }
.site-footer .footer-meta { font-size: 12.5px; color: #999; line-height: 1.8; }
.site-footer .sep { margin: 0 6px; color: #666; }
.site-footer .nowrap { white-space: nowrap; }
.site-footer .social a, .site-footer .btn-top { text-decoration: none; }
.event-box .muted { color: var(--muted); font-size: .9em; }
.no-events { text-align: center; color: var(--muted); }

/* Festivals intro (v38) */
.festivals-intro { text-align: center; max-width: 720px; margin: 0 auto 32px; }   /* v44: heading removed; same gap above and below */
.festivals-intro p { margin: 0; }

/* Past (expired) festivals: one line each, expand to see the details in grey (v39) */
.past-festivals { margin-top: 28px; }
.past-festivals .past-title { text-align: center; font-size: 1.05em; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.past-festival { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 8px; }
.past-festival > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; color: #777; }
.past-festival > summary::-webkit-details-marker { display: none; }
.past-festival > summary:hover { color: #444; }
.past-festival > summary .fa { transition: transform .2s; }
.past-festival[open] > summary .fa { transform: rotate(180deg); }
.past-festival > .show-row { padding: 0 16px 16px; border: 0; }
.show-row.expired { filter: grayscale(1); opacity: .6; }
.show-row.expired .event-box { border-inline-start-color: #999; }

/* Festival pictures: one 3:2 frame for all (v41). New uploads are already 1200x800; older ones are trimmed to fit here. */
.show-row img.festival-pic { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--line); }

/* Festival Share button and menu (v41) */
.share { position: relative; margin-top: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.share-btn { padding: .5em 1.1em; }
.share-menu { position: absolute; z-index: 20; top: calc(100% + 6px); inset-inline-start: 0; min-width: 210px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 6px 0; }
.share-menu[hidden] { display: none; }
.share-menu a { display: flex; align-items: center; gap: 8px; padding: 10px 16px; color: var(--ink); text-decoration: none; }
.share-menu a:hover, .share-menu a:focus-visible { background: #f6f2ee; color: var(--accent-dark); }
.share-menu a[hidden] { display: none; }
.share-menu .fa-facebook-official { color: #1877f2; }
.share-menu .fa-instagram { color: #c13584; }
.share-note { font-size: .9em; color: var(--accent-dark); }
.show-row:target .event-box { box-shadow: 0 0 0 3px rgba(181,96,63,.35); }

/* v46: long festival text (titles, notes, web addresses) wraps inside its box
   instead of pushing the box past the screen edge on phones. */
.show-row.two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 700px) { .show-row.two-col { grid-template-columns: minmax(0, 1fr); } }
.show-row .col, .past-festival, .past-festival > summary > span { min-width: 0; }
.show-row, .past-festival > summary { overflow-wrap: anywhere; word-break: break-word; }
.event-box dl { grid-template-columns: auto minmax(0, 1fr); }
.event-box dd, .event-box h3, .show-row p { min-width: 0; overflow-wrap: anywhere; }
.share-menu { max-width: calc(100vw - 40px); }
@media (max-width: 420px) {
    .event-box { padding: 14px; }
    .event-box dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .event-box dt { margin-top: .4em; }
    .past-festival > .show-row { padding: 0 10px 12px; }
    .past-festival > summary { padding: 10px 12px; }
}
