/**
 * Pavilion Theme CSS
 *
 * Catalogue on paper: warm off-white ground, Fraunces serif display,
 * Manrope text, hairline rules, a single muted-gold accent. Built for the
 * split-screen shell (shell.css) on thailandfilm.events.
 * Requires Google Fonts: Fraunces, Manrope, Noto Sans Thai (loaded by header.php).
 *
 * @version 1.1.0 - 2026-10-19: colours taken from the TIFFCOM 2026 artwork
 *                  (indigo #262262 to #2B3990 on cream #FFFFF2) in place of
 *                  the muted gold on warm paper
 * @version 1.0.0 - 2026-10-19
 */

/* Theme Variables (tokens the stock pages expect, plus the shell's) */
:root {
    --primary-color: #2B3990;      /* artwork indigo */
    --secondary-color: #262262;    /* artwork deep indigo */
    --accent-color: #FFFFF2;       /* panel: the artwork's cream */
    --text-color: #262262;
    --background-color: #FFFFF2;   /* page: the artwork's cream */
    --card-background: #FFFFFF;
    --surface-ink: #262262;
    --surface-muted: #5E5F80;
    --surface-subtle: #F4F3E3;
    --on-primary: #FFFFF2;
    --border-color: #DADAE4;
    --shadow-color: rgba(38, 34, 98, 0.18);
    --hover-shadow: rgba(43, 57, 144, 0.3);
    --muted-color: #6A6B8A;
    --primary-hover: #262262;
    --display-font: 'Fraunces', Georgia, 'Times New Roman', serif;
    --body-font: 'Manrope', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
    --panel-bg: var(--accent-color);
    --panel-ink: var(--text-color);
}

/* Body */
body {
    font-family: var(--body-font);
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.55;
}

/* Typography */
h1, h2, h3, h4, h5, h6,
.page-title {
    font-family: var(--display-font);
    font-weight: 500;
    color: var(--text-color);
    letter-spacing: 0;
    text-wrap: balance;
}

h1, .page-title {
    font-weight: 300;
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    line-height: 1.08;
}

.page-subtitle {
    color: var(--muted-color);
    font-size: 0.95rem;
}

a { color: var(--primary-color); }

/* Eyebrow labels */
.eyebrow,
.filter-label,
.filter-group label,
.breadcrumbs {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted-color);
}

/* Book Meeting button (shell CTA and in-page uses) */
.btn-book-meeting {
    background: var(--primary-color);
    color: var(--on-primary) !important;
    border: 1px solid var(--primary-color);
    border-radius: 2px;
    letter-spacing: 0.06em;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: none;
    transition: background 0.2s;
}
.btn-book-meeting:hover { background: var(--primary-hover); border-color: var(--primary-hover); transform: none; }

/* Filter bar, controls */
.filter-bar,
.filter-sidebar-container,
.controls-bar {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--border-color);
    border-radius: 0;
}

.filter-checkbox { accent-color: var(--primary-color); }

/* Inputs */
.search-input,
.search-type-select,
select,
input[type="text"],
input[type="email"],
input[type="search"],
textarea {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 2px;
    font-family: var(--body-font);
}
.search-input:focus, input[type="text"]:focus, input[type="email"]:focus,
input[type="search"]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(43, 57, 144, 0.18);
}
::placeholder { color: var(--muted-color); }

.search-button, .search-submit, .btn-primary, .btn-submit {
    background: var(--primary-color);
    color: var(--on-primary);
    border: 1px solid var(--primary-color);
    border-radius: 2px;
    letter-spacing: 0.06em;
    font-weight: 700;
}
.search-button:hover, .search-submit:hover, .btn-primary:hover, .btn-submit:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-secondary, .btn-clear-search, .btn-cancel, .popular-search-tag {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 2px;
}
.btn-secondary:hover, .btn-clear-search:hover, .popular-search-tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Cards: flat paper plates with hairline edges */
.company-card,
.film-card,
.content-card,
.company-result-card,
.film-result-card,
.series-result-card,
.rep-result-card,
.quick-link-card,
.representative-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    box-shadow: none;
    transition: border-color 0.2s, transform 0.2s;
}
.company-card:hover, .film-card:hover, .content-card:hover,
.company-result-card:hover, .film-result-card:hover, .series-result-card:hover,
.rep-result-card:hover, .quick-link-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 14px 30px var(--shadow-color);
    transform: translateY(-2px);
}

.company-card-logo, .company-result-logo {
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
}

.company-initial, .company-logo-placeholder, .film-poster-placeholder {
    background: var(--surface-subtle);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    font-family: var(--display-font);
}

.company-card-name, .film-title, .content-title, .company-result-name,
.film-result-title, .series-result-title, .rep-result-name, .quick-link-title {
    font-family: var(--display-font);
    font-weight: 500;
    color: var(--text-color);
}

.company-card-overlay, .film-card-overlay, .content-overlay {
    background: linear-gradient(transparent, rgba(30, 27, 78, 0.92));
}

.view-details { color: var(--primary-color); }

/* Badges */
.activity-badge, .genre-badge {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--muted-color);
    border-radius: 2px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.66rem;
}
.content-count { background: var(--primary-color); color: var(--on-primary); }

/* Status badges: quiet, inked */
.status-in-dev { background: #EAE3D6; color: #4A4036; }
.status-in-prod { background: #DCCBA8; color: #3A2E14; }
.status-post-prod { background: #CFC4D9; color: #3A2F4A; }
.status-completed { background: #CDD9C9; color: #2E4A30; }
.status-released-thai { background: #E3CBCB; color: #5A2E2E; }
.status-released-intl { background: var(--primary-color); color: var(--on-primary); }
.status-seeking-coprod { background: var(--secondary-color); color: var(--background-color); }

/* Tabs */
.tab-navigation { border-bottom: 1px solid var(--border-color); }
.tab-button {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.74rem;
    color: var(--muted-color);
    background: transparent;
}
.tab-button:hover { color: var(--text-color); }
.tab-button.active { color: var(--primary-color); border-bottom: 1px solid var(--primary-color); }

/* Pagination */
.pagination-link { background: transparent; border: 1px solid var(--border-color); color: var(--text-color); border-radius: 2px; }
.pagination-link:hover { border-color: var(--primary-color); color: var(--primary-color); }
.pagination-item.active .pagination-link { background: var(--primary-color); border-color: var(--primary-color); color: var(--on-primary); }

/* Quick links */
.quick-links-section { background: var(--surface-subtle); border-top: 1px solid var(--border-color); }
.quick-link-icon { color: var(--primary-color); }
.quick-link-desc { color: var(--muted-color); }

/* Booking form */
.booking-container, .booking-form, .form-section {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    color: var(--text-color);
}
.form-section { padding: 1.5rem 1.75rem; }
.form-group label, .form-intro, .checkbox-item { color: var(--text-color); }
.required-indicator { color: var(--primary-color); }
.success-message { background: #E6EFE3; border: 1px solid #8FB08A; color: #2E4A30; }
.error-message { background: #F3DEDE; border: 1px solid #C98C8C; color: #5A2E2E; }

/* Modal */
.modal { background: rgba(30, 27, 78, 0.6); }
.modal-content { background: var(--card-background); border: 1px solid var(--border-color); color: var(--text-color); }
.modal-close { color: var(--muted-color); }
.modal-close:hover { color: var(--primary-color); }

.no-results { color: var(--muted-color); }
.loading { color: var(--primary-color); }

/* Footer / back to top */
.site-footer { background: transparent; border-top: 1px solid var(--border-color); color: var(--muted-color); }
.back-to-top { background: var(--primary-color); color: var(--on-primary); }

/* ---------- Home page (index.php) ---------- */
.home {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.4rem 0 3rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.home-intro h1 {
    font-size: clamp(2rem, 3.6vw, 3.2rem);
    font-weight: 300;
    margin: 0 0 0.9rem;
    max-width: 18ch;
}
.home-intro h1 em { font-style: italic; color: var(--primary-color); }
.home-intro p {
    max-width: 62ch;
    margin: 0;
    font-size: 1.02rem;
    color: #3D3E66;
}

.home-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-color);
}
.home-section-head h2 { font-size: 1.35rem; margin: 0; }
.home-section-head a { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; }

/* Contents: the catalogue's front matter */
.contents {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    column-gap: 2.5rem;
    row-gap: 0;
}
.contents a {
    display: grid;
    grid-template-columns: 2.2rem 44px 1fr;
    gap: 0.9rem;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    text-decoration: none;
    min-width: 0;
}
.contents a:hover .contents-name { color: var(--primary-color); }
.contents-num {
    font-family: var(--display-font);
    font-size: 0.85rem;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}
.contents-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    padding: 3px;
}
.contents-logo-blank {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-subtle);
    border: 1px solid var(--border-color);
    font-family: var(--display-font);
    color: var(--primary-color);
}
.contents-name {
    font-family: var(--display-font);
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.2;
    display: block;
}
.contents-line {
    display: block;
    font-size: 0.78rem;
    color: var(--muted-color);
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Featured titles */
.featured {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.9rem;
}
.featured a {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--surface-subtle);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: #FFFFF2;
}
.featured img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s; }
.featured a:hover img { transform: scale(1.04); }
.featured figcaption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 1.8rem 0.6rem 0.55rem;
    background: linear-gradient(transparent, rgba(30, 27, 78, 0.85));
    font-size: 0.74rem;
    line-height: 1.25;
}
.featured figcaption b { display: block; font-family: var(--display-font); font-weight: 500; font-size: 0.85rem; }

.home-meet {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: center;
    padding: 1.6rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.home-meet h2 { margin: 0 0 0.3rem; font-size: 1.3rem; }
.home-meet p { margin: 0; color: var(--muted-color); font-size: 0.92rem; max-width: 56ch; }
.home-meet .btn-book-meeting { padding: 0.8rem 1.4rem; white-space: nowrap; text-decoration: none; }

@media (max-width: 760px) {
    .home { padding-top: 1.4rem; gap: 2.2rem; }
    .contents { grid-template-columns: 1fr; }
    .home-meet { grid-template-columns: 1fr; }
    /* Three posters across on a phone, title only */
    .featured { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
    .featured figcaption { padding: 1.4rem 0.4rem 0.4rem; font-size: 0; }
    .featured figcaption b { font-size: 0.68rem; line-height: 1.2; }
}

@media (prefers-reduced-motion: reduce) {
    .featured img, .company-card, .film-card, .content-card { transition: none; }
}


/* ---------- Company page (company.php): one catalogue entry ---------- */
.co {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.6rem 0 3rem;
    display: flex;
    flex-direction: column;
    gap: 2.4rem;
}

.co-masthead {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.co-masthead a { text-decoration: none; }
.co-back::before { content: "← "; }
.co-number { font-family: var(--display-font); font-size: 1rem; letter-spacing: 0; text-transform: none; color: var(--primary-color); font-weight: 500; }
.co-number span { color: var(--muted-color); font-size: 0.85rem; }
.co-step { display: flex; gap: 1.2rem; }

.co-head {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: 1.4rem;
    align-items: center;
}
.co-logo {
    width: 96px;
    height: 96px;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}
.co-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.co-logo span { font-family: var(--display-font); font-size: 2.4rem; color: var(--primary-color); }
.co-title h1 { margin: 0.25rem 0 0; font-size: clamp(2rem, 3.4vw, 3rem); }
.co-legal { margin-top: 0.3rem; font-size: 0.8rem; color: var(--muted-color); }
.co-book { padding: 0.8rem 1.3rem; text-decoration: none; white-space: nowrap; }

.co-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 3rem;
    align-items: start;
}
.co-statement { display: flex; flex-direction: column; gap: 1.8rem; min-width: 0; }
.co-biog {
    margin: 0;
    font-family: var(--display-font);
    font-size: 1.22rem;
    line-height: 1.55;
    font-weight: 300;
    max-width: 60ch;
}
.co-aims p { margin: 0.4rem 0 0; max-width: 62ch; }

.co-side {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    padding-left: 1.6rem;
    border-left: 1px solid var(--border-color);
    min-width: 0;
}
.co-reps { list-style: none; margin: 0.6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.co-reps li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 0.8rem; align-items: center; }
.co-reps img, .co-rep-blank {
    width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
    background: var(--surface-subtle); border: 1px solid var(--border-color);
}
.co-rep-blank { display: flex; align-items: center; justify-content: center; font-family: var(--display-font); color: var(--primary-color); }
.co-reps b { display: block; font-weight: 600; font-size: 0.92rem; }
.co-reps span { display: block; font-size: 0.8rem; color: var(--muted-color); overflow-wrap: anywhere; }

.co-contact { margin: 0.6rem 0 0; display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: 0.45rem 0.8rem; font-size: 0.86rem; }
.co-contact dt { color: var(--muted-color); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; padding-top: 0.15rem; }
.co-contact dd { margin: 0; overflow-wrap: anywhere; }
.co-sel { user-select: all; }

.co-section { display: flex; flex-direction: column; }
.co-section-head {
    font-size: 1.5rem;
    margin: 0 0 0.4rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--text-color);
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
}
.co-section-head span { font-family: var(--body-font); font-size: 0.8rem; color: var(--muted-color); font-weight: 600; }

.entry {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 2.2rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
    scroll-margin-top: 1rem;
}
.entry-highlight { background: linear-gradient(90deg, rgba(43, 57, 144, 0.07), transparent 70%); }
.entry-poster img { width: 100%; height: auto; display: block; box-shadow: 0 12px 28px var(--shadow-color); }
.entry-service .entry-poster img { aspect-ratio: 4 / 3; object-fit: cover; }
.entry-poster-blank {
    aspect-ratio: 2 / 3;
    background: var(--surface-subtle);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    font-family: var(--display-font);
    color: var(--muted-color);
}
.entry-service .entry-poster-blank { aspect-ratio: 4 / 3; }
.entry-body { min-width: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.entry-title { margin: 0; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.1; }
.entry-status {
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.2rem 0.55rem;
}
.entry-credits { margin: 0; display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.35rem 1rem; font-size: 0.9rem; }
.entry-credits dt { color: var(--muted-color); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; padding-top: 0.2rem; }
.entry-credits dd { margin: 0; }
.entry-synopsis { max-width: 64ch; line-height: 1.65; }
.entry-pitch {
    margin: 0.2rem 0 0;
    padding: 0.2rem 0 0.2rem 1.1rem;
    border-left: 2px solid var(--primary-color);
    font-family: var(--display-font);
    font-style: italic;
    font-size: 1.08rem;
    line-height: 1.5;
    max-width: 58ch;
    color: #3D3E66;
}
.entry-trailer { margin-top: 0.4rem; display: flex; flex-direction: column; gap: 0.5rem; max-width: 640px; }
.entry-video { position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: #000; }
.entry-video iframe, .entry-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.co .video-poster-wrap { position: relative; aspect-ratio: 16 / 9; max-width: 100%; overflow: hidden; cursor: pointer; background: #000; }
.co .video-poster-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.co .video-play-overlay {
    position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
    border-radius: 50%; background: rgba(255, 255, 242, 0.92); display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s;
}
.co .video-play-overlay svg { width: 26px; height: 26px; fill: var(--text-color); margin-left: 4px; }
.co .video-poster-wrap:hover .video-play-overlay { transform: scale(1.08); }

.co-foot {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: center;
    padding: 1.6rem;
    background: var(--surface-subtle);
    border: 1px solid var(--border-color);
}
.co-foot h2 { margin: 0 0 0.3rem; font-size: 1.3rem; }
.co-foot p { margin: 0; color: var(--muted-color); font-size: 0.9rem; }
.co-foot .btn-book-meeting { padding: 0.8rem 1.3rem; text-decoration: none; white-space: nowrap; }

.co-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.co-pager a {
    display: flex; flex-direction: column; gap: 0.2rem;
    padding: 1rem 0; border-top: 1px solid var(--border-color);
    text-decoration: none; color: var(--text-color);
    font-family: var(--display-font); font-size: 1.1rem;
}
.co-pager a span { font-family: var(--body-font); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-color); }
.co-pager a:hover { color: var(--primary-color); }
.co-pager-next { text-align: right; grid-column: 2; }

@media (max-width: 1100px) {
    .co-intro { grid-template-columns: 1fr; gap: 2rem; }
    .co-side { padding-left: 0; border-left: 0; border-top: 1px solid var(--border-color); padding-top: 1.4rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 760px) {
    .co { gap: 1.8rem; padding-top: 1rem; }
    .co-head { grid-template-columns: 64px minmax(0, 1fr); gap: 1rem; }
    .co-logo { width: 64px; height: 64px; padding: 5px; }
    .co-book { grid-column: 1 / -1; text-align: center; }
    .co-biog { font-size: 1.08rem; }
    .entry { grid-template-columns: 1fr; gap: 1.2rem; padding: 1.6rem 0; }
    .entry-poster { max-width: 220px; }
    .entry-service .entry-poster { max-width: 100%; }
    .entry-credits { grid-template-columns: 5.5rem minmax(0, 1fr); }
    .co-foot { grid-template-columns: 1fr; }
    .co-step { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .co .video-play-overlay { transition: none; }
}

/* ---------- Wide banner artwork (home page, phones only) ---------- */
.home-banner { display: none; }
@media (max-width: 900px) {
    .home-banner {
        display: block;
        margin-top: -32px; /* sit directly under the indigo bar (main has 32px top padding) */
        margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
        margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px)));
    }
    .home-banner img { display: block; width: 100%; height: auto; }
}
