/*
Theme Name: A49
Theme URI: https://a49.gr
Author: A49 / Vangelis
Author URI: https://a49.gr
Description: Custom block theme για τον χώρο τέχνης A49 — all-mono typography (JetBrains Mono), B&W παλέτα με ώχρα Μεσσηνίας accent. Editorial museum aesthetic με vertical bar separator ως γενετικό device.
Requires at least: 6.5
Tested up to: 6.7
Requires PHP: 8.1
Version: 0.1.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: a49
Tags: full-site-editing, block-patterns, blog, art, portfolio
*/

/* Theme styles live στο theme.json για block editor compatibility.
   Αυτό το αρχείο κρατά μόνο edge-case CSS που το block editor δεν καλύπτει. */

/* Vertical bar separator device — επαναχρησιμοποιείται σε breadcrumbs, lang switcher, product specs */
.has-bar-separator > *:not(:last-child)::after {
    content: "|";
    margin: 0 .75em;
    opacity: .45;
}

/* Lockup του logo: A | 49 με κάθετη γραμμή στη ΜΕΣΗ (μεταξύ A και 49).
   Pattern: `<a class="a49-logotype-link"><span class="a49-logotype">A<span class="a49-logotype__bar"></span>49</span></a>`
   Replaces the older `::after` approach που έβαζε bar AFTER "A49" (λάθος θέση). */
.a49-logotype-link {
    color: inherit;
    text-decoration: none;
    display: inline-block;
}
.a49-logotype {
    font-family: var(--wp--preset--font-family--display);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.a49-logotype__bar {
    display: inline-block;
    width: 1px;
    background: currentColor;
    height: 0.85em;
    margin: 0 0.3em;
    vertical-align: middle;
    transform: translateY(-0.05em);
}

/* Audit R2 H9-2 — artist portrait placeholder. Render empty featured-image block
   as a small dark square με monogram-style placeholder so the grid αlignment
   stays consistent even πριν τα portrait uploads. */
.a49-artist-portrait:empty,
.a49-artist-portrait .wp-block-post-featured-image__overlay:only-child,
.wp-block-post-featured-image.a49-artist-portrait:not(:has(img)) {
    display: block;
    background: var(--wp--preset--color--ink, #0A0A0A);
    height: 400px;
    position: relative;
}
.wp-block-post-featured-image.a49-artist-portrait:not(:has(img))::after {
    content: "A49";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(242, 239, 233, 0.18);
    font-family: var(--wp--preset--font-family--mono);
    font-size: 14px;
    letter-spacing: 0.2em;
}

/* Wall label component — με κάθετη γραμμή αριστερά */
.a49-wall-label {
    border-left: 1px solid currentColor;
    padding-left: 20px;
}

/* Audit R2 H8-1 — hide empty wall-label rows (eyebrow + value pairs).
   When a value paragraph is :empty (binding returned ''), hide it AND the
   preceding eyebrow. Uses :has() which is supported in all modern browsers.
   Also handles wp:post-terms when empty (renders without <a>). */
.a49-wall-label p:empty {
    display: none;
}
.a49-wall-label > .a49-eyebrow:has(+ p:empty),
.a49-wall-label > p[class*="a49-eyebrow"]:has(+ p:empty) {
    display: none;
}
/* post-terms element που δεν έχει `<a>` children = no terms applied → hide.
   Empty post-terms renders as `<div class="wp-block-post-terms taxonomy-..."></div>`
   ή με invisible whitespace, so `:empty` is unreliable. Use :not(:has(a)) instead. */
.a49-wall-label > [class*="wp-block-post-terms"]:not(:has(a)),
.a49-wall-label > div[class*="taxonomy-"]:not(:has(a)) {
    display: none !important;
}
/* Hide the preceding eyebrow when its post-terms sibling has no links. */
.a49-wall-label > .a49-eyebrow:has(+ [class*="wp-block-post-terms"]:not(:has(a))),
.a49-wall-label > p[class*="a49-eyebrow"]:has(+ [class*="wp-block-post-terms"]:not(:has(a))),
.a49-wall-label > .a49-eyebrow:has(+ div[class*="taxonomy-"]:not(:has(a))) {
    display: none !important;
}
/* `wp:post-terms` renders NOTHING (not even empty div) when there are no terms.
   In our wall-label layout, the partners eyebrow becomes the LAST child when
   post-terms is empty. Hide last-child eyebrow as a catch-all. */
.a49-wall-label > .a49-eyebrow:last-child,
.a49-wall-label > p[class*="a49-eyebrow"]:last-child {
    display: none !important;
}

/* Image placeholders για content που δεν έχει φωτογραφία ακόμα */
.a49-img-placeholder {
    background: var(--wp--preset--color--ink);
    aspect-ratio: 4/5;
    display: grid;
    place-items: center;
    color: rgba(242, 239, 233, .3);
    font-family: var(--wp--preset--font-family--mono);
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
}

/* Handoff #5 Fix 6 — when about_image binding returns empty (no meta set),
   hide the image figure + collapse the about column layout to single-column.
   Modern CSS :has() — Chrome 105+, Safari 15.4+, Firefox 121+. */
.a49-img-placeholder img:not([src]),
.a49-img-placeholder img[src=""] {
    display: none;
}
figure.a49-img-placeholder:not(:has(img[src]:not([src=""]))) {
    display: none;
}
/* When the image column has only the empty figure, hide that column
   and let the text column expand to full width (flex layout). */
.has-cream-background-color .wp-block-columns:has(figure.a49-img-placeholder:not(:has(img[src]:not([src=""])))) > .wp-block-column:has(> figure.a49-img-placeholder) {
    display: none !important;
}
.has-cream-background-color .wp-block-columns:has(figure.a49-img-placeholder:not(:has(img[src]:not([src=""])))) > .wp-block-column:not(:has(> figure.a49-img-placeholder)) {
    flex-basis: 100% !important;
    max-width: 720px;
    margin-inline: auto;
}

/* Hide focus outlines για mouse users, keep για keyboard */
*:focus:not(:focus-visible) { outline: none; }
*:focus-visible {
    outline: 2px solid var(--wp--preset--color--accent);
    outline-offset: 2px;
}

/* Tabular numerals για prices/specs */
.a49-tabular { font-variant-numeric: tabular-nums; }

/* ============================================================
 * Handoff #6 Fix 7 — Homepage upcoming + past sections
 * (Upcoming: paper/white. Past: cream. Both with ink text.)
 * Replaces the dark-bg + *-inv approach from Phase 2.I.
 * ============================================================ */
.a49-upcoming-section {
    background: var(--wp--preset--color--paper, #FFFFFF);
    color: var(--wp--preset--color--text, #0A0A0A);
    border-top: 1px solid var(--wp--preset--color--rule, #E5E0D8);
}

.a49-past-section {
    background: var(--wp--preset--color--cream, #F2EFE9);
    color: var(--wp--preset--color--text, #0A0A0A);
    border-top: 1px solid var(--wp--preset--color--rule, #E5E0D8);
}

/* Eyebrow + section heading colors σε light bg */
.a49-upcoming-section .a49-eyebrow,
.a49-past-section .a49-eyebrow {
    color: var(--wp--preset--color--muted, #6B6663);
}

.a49-upcoming-section .a49-section-heading,
.a49-past-section .a49-section-heading,
.a49-upcoming-section h2,
.a49-past-section h2 {
    color: var(--wp--preset--color--ink, #0A0A0A);
}

/* Card titles on light bg */
.a49-upcoming-section .wp-block-post-title a,
.a49-past-section .wp-block-post-title a,
.a49-upcoming-section .a49-card-title a,
.a49-past-section .a49-card-title a {
    color: var(--wp--preset--color--ink, #0A0A0A);
    text-decoration: none;
}
.a49-upcoming-section .wp-block-post-title a:hover,
.a49-past-section .wp-block-post-title a:hover,
.a49-upcoming-section .a49-card-title a:hover,
.a49-past-section .a49-card-title a:hover {
    color: var(--wp--preset--color--accent, #B8843A);
}

/* Card dates + subtitle */
.a49-upcoming-section .a49-card-date,
.a49-past-section .a49-card-date,
.a49-upcoming-section .a49-card-date *,
.a49-past-section .a49-card-date *,
.a49-upcoming-section .a49-card-subtitle,
.a49-past-section .a49-card-subtitle,
.a49-upcoming-section .a49-muted,
.a49-past-section .a49-muted {
    color: var(--wp--preset--color--muted, #6B6663);
}

/* Artist subtitle links: neutralize visited + ώχρα hover */
.a49-upcoming-section a,
.a49-past-section a {
    color: var(--wp--preset--color--text, #0A0A0A);
}
.a49-upcoming-section a:visited,
.a49-past-section a:visited {
    color: inherit;
}
.a49-upcoming-section .a49-card-subtitle a,
.a49-past-section .a49-card-subtitle a {
    color: var(--wp--preset--color--muted, #6B6663);
}
.a49-upcoming-section .a49-card-subtitle a:hover,
.a49-past-section .a49-card-subtitle a:hover {
    color: var(--wp--preset--color--accent, #B8843A);
}

/* "Όλες οι εκθέσεις →" button on cream bg */
.a49-past-section .a49-link-inv,
.a49-past-section .a49-link-inv:link,
.a49-past-section .a49-link-inv:visited {
    color: var(--wp--preset--color--ink, #0A0A0A) !important;
    border: 1px solid var(--wp--preset--color--ink, #0A0A0A) !important;
    background: transparent !important;
}
.a49-past-section .a49-link-inv:hover {
    background: var(--wp--preset--color--ink, #0A0A0A) !important;
    color: var(--wp--preset--color--paper, #FFFFFF) !important;
}

/* ============================================================
 * Audit 2026-05-12 R1#6 (H4-1 + H7-2) — kill empty bullets/dashes που
 * εμφανίζονται πριν από κάθε post σε query loops. WP wraps post-template
 * σε <ul> by default — list-style: disc puts a bullet character.
 * Handoff #6b — stronger selector + transparent marker (list-style-type too).
 * ============================================================ */
.wp-block-query .wp-block-post-template,
.wp-block-post-template,
ul.wp-block-post-template,
ul.wp-block-post-template > li,
.wp-block-post-template > li,
.a49-upcoming-section .wp-block-post-template,
.a49-past-section .wp-block-post-template {
    list-style: none !important;
    list-style-type: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}
.wp-block-post-template > li,
.wp-block-post-template > .wp-block-post {
    list-style: none !important;
    list-style-type: none !important;
}
.wp-block-post-template > li::marker,
ul.wp-block-post-template > li::marker,
.wp-block-post-template > .wp-block-post::marker {
    content: '' !important;
    color: transparent !important;
    display: none !important;
    font-size: 0 !important;
}
.wp-block-post-template > li::before,
.wp-block-post-template > .wp-block-post::before {
    content: none !important;
    display: none !important;
}
/* Hide stray <hr> dividers σε Query Loop */
.wp-block-query hr,
.wp-block-post-template > hr {
    display: none !important;
}

/* ============================================================
 * Handoff #5b Fix A6 — defensive footer/dark-section contrast.
 * Global theme.json text color (#0A0A0A) was leaking onto paragraphs
 * inside ink-bg containers via WP's element-level color inheritance,
 * making footer text invisible (black on black).
 * Force light cream text on any element inside a has-ink-background-color group.
 * ============================================================ */
.wp-block-group[class*="has-ink-background-color"] p,
.wp-block-group[class*="has-ink-background-color"] li,
footer.wp-block-group p,
footer.wp-block-group li {
    color: rgba(242, 239, 233, 0.65) !important;
}
.wp-block-group[class*="has-ink-background-color"] p a,
.wp-block-group[class*="has-ink-background-color"] li a,
footer.wp-block-group p a {
    color: rgba(242, 239, 233, 0.85) !important;
    text-decoration: none;
}
.wp-block-group[class*="has-ink-background-color"] p a:hover,
footer.wp-block-group p a:hover {
    color: #F2EFE9 !important;
}

/* Footer logotype: explicit cream + larger για visibility */
footer .a49-logotype-link,
footer .a49-logotype {
    color: #F2EFE9 !important;
}
footer .a49-logotype {
    font-size: 28px;
}

/* Audit R2 H6-2 — hide placeholder links (href="#" ή ending in "/#") σε footer
   until real social URLs are configured. Prevents dead clicks. */
footer a[href="#"],
footer a[href$="/#"],
footer p:has(> a[href="#"]),
footer p:has(> a[href$="/#"]) {
    display: none !important;
}

/* ============================================================
 * Handoff #6B Task 2 — WC injections hard hide από header
 * (verification path σε style.css, mirrors header.css rule).
 * ============================================================ */
.a49-header a[href*="/my-account"],
.a49-header a[href*="/cart"],
.a49-header a[href*="/wp-login"],
.a49-header .wp-block-loginout,
.a49-header .wp-block-woocommerce-customer-account,
.a49-header .wp-block-woocommerce-mini-cart {
    display: none !important;
}

/* ============================================================
 * Handoff #5 Fix 5 — neutralize default browser :visited purple/magenta
 * + keep accessible underline but tinted ώχρα accent (matches brand).
 * ============================================================ */
a:visited {
  color: inherit;
}

/* Internal title links — no underline σε resting state, accent on hover */
.wp-block-post-title a,
.wp-block-post-title a:visited,
.a49-card-title-inv a,
.a49-card-title-inv a:visited,
a.a49-link-inv,
a.a49-link-inv:visited {
  color: inherit;
  text-decoration: none;
}
.wp-block-post-title a:hover,
.a49-card-title-inv a:hover {
  color: var(--wp--preset--color--accent, #B8843A);
}

/* Card title links on dark bg — explicit cream με ochre hover */
.a49-card-title-inv a,
.a49-card-title-inv a:visited {
  color: var(--wp--preset--color--text-inv, #F2EFE9) !important;
}
.a49-card-title-inv a:hover {
  color: var(--wp--preset--color--accent, #B8843A) !important;
}

/* Inline links in body copy — keep underline but tinted ώχρα (accessibility) */
.wp-block-post-content a:not(.wp-block-button__link),
.wp-block-post-content a:visited:not(.wp-block-button__link),
.a49-press-release a,
.a49-press-release a:visited {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(184, 132, 58, 0.6); /* accent 60% */
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.wp-block-post-content a:hover:not(.wp-block-button__link),
.a49-press-release a:hover {
  text-decoration-color: var(--wp--preset--color--accent, #B8843A);
}

/* Smooth fade-to-black page transitions (motion-safe) */
@media (prefers-reduced-motion: no-preference) {
    body { transition: opacity .15s ease; }
}


/* ============================================================
 * Press release section — hide when binding returns empty (no _a49_press_release meta).
 * Pattern mirrors the wp:cover ink fallback above.
 * ============================================================ */
.a49-press-release-section:has(.a49-press-release:empty) {
    display: none;
}

/* ============================================================
 * Single-exhibition template (Handoff #4 — Task 2):
 * 21:9 hero edge-to-edge + sticky wall label.
 * ============================================================ */
.a49-exhibition-hero-img {
    margin-top: 0 !important;
    margin-bottom: 0;
    width: 100%;
}
.a49-exhibition-hero-img img,
.a49-exhibition-hero-img .wp-block-post-featured-image__overlay {
    width: 100%;
    height: auto;
    aspect-ratio: 21/9;
    object-fit: cover;
    display: block;
}

/* Sticky wall label — sticks below fixed header (header height ≈ 72px + 48px breathing) */
.a49-wall-label[style*="position:sticky"],
.a49-wall-label[style*="position: sticky"] {
    align-self: flex-start;
}

/* Mobile: drop the sticky behavior, render as static block */
@media (max-width: 900px) {
    .a49-wall-label[style*="position:sticky"],
    .a49-wall-label[style*="position: sticky"] {
        position: static !important;
        top: auto !important;
    }
}

/* ============================================================
 * Archive-exhibition template (Handoff #4 — Task 3):
 * Year filter bar styling.
 * ============================================================ */
.a49-year-filter {
    display: flex;
    flex-wrap: wrap;
    border-top: 1px solid var(--wp--preset--color--rule, #E5E0D8);
    border-bottom: 1px solid var(--wp--preset--color--rule, #E5E0D8);
    font-family: var(--wp--preset--font-family--mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.a49-year-filter a {
    padding: 18px 24px;
    color: var(--wp--preset--color--muted, #6B6663);
    text-decoration: none;
    border-right: 1px solid var(--wp--preset--color--rule, #E5E0D8);
    transition: background 0.15s ease, color 0.15s ease;
}
.a49-year-filter a:last-child { border-right: none; }
.a49-year-filter a:hover { color: var(--wp--preset--color--ink, #0A0A0A); }
.a49-year-filter a.on {
    color: var(--wp--preset--color--ink, #0A0A0A);
    background: #FAFAF7;
}

/* ── About / page featured-image hero — short panoramic band (matches home hero) 2026-05-25 ── */
.a49-page-hero img { display:block; width:100%; aspect-ratio: 4 / 1; height:auto; object-fit:cover; }
@media (max-width:782px){ .a49-page-hero img { aspect-ratio: 16 / 9; } }

/* About inline portrait — float beside text on desktop, stack full-width on mobile (2026-05-25) ── */
.a49-about-portrait { margin: 0 32px 24px 0; }
@media (max-width:600px){ .a49-about-portrait { float:none !important; width:100% !important; margin:0 0 24px 0 !important; } .a49-about-portrait img { width:100% !important; } }
