/**
 * Kunst Galerie — Frontend Styles
 *
 * Registered by KG_Elementor_Integration::register_assets().
 * Enqueued only on singular KG post types and their archives.
 * Widgets add specific styles in subsequent phases.
 *
 * @package KunstGalerie
 */

/* =========================================================
   CSS Custom Properties — Design Tokens
   All magic numbers live here. Change once, applies everywhere.
   ========================================================= */

:root {
    /* ── Layout ── */
    --kg-max-width:     1600px;  /* global content column width    */
    --kg-padding-x:     24px;    /* horizontal page gutter         */
    --kg-header-height: 88px;    /* sticky header height           */

    /* ── Core colour palette ── */
    --kg-color-dark:        #1A1A1A;  /* headings, text, controls        */
    --kg-color-dark-hover:  #333333;  /* dark bg on hover (buttons)      */
    --kg-color-white:       #FFFFFF;  /* backgrounds, inverted text      */
    --kg-color-body:        #444444;  /* body copy                       */
    --kg-color-muted:       #555555;  /* footer / address / form text    */
    --kg-color-mid:         #666666;  /* secondary labels, dates, icons  */
    --kg-color-subtle:      #888888;  /* tertiary text, social links     */
    --kg-color-faint:       #999999;  /* empty-states, disabled text     */
    --kg-color-sold:        #A2A2A2;  /* sold-state button text          */

    /* ── Borders ── */
    --kg-border:        #E5E5E5;  /* primary dividers                   */
    --kg-border-light:  #F0F0F0;  /* subtle rows / nav hover bg         */
    --kg-border-dim:    #CCCCCC;  /* disabled borders / breadcrumb sep  */
    --kg-border-input:  #DDDDDD;  /* form field borders                 */
    --kg-border-sold:   #C8C8C8;  /* sold-state button border           */

    /* ── Surface backgrounds ── */
    --kg-bg-soft: #F5F5F5;            /* placeholder, widget, pswp bg    */
    --kg-bg-card: #F8F8F8;            /* CTA card background             */
    --kg-bg-hero: rgb(243, 245, 247); /* hero gray side panel            */
}

/* =========================================================
   Elementor integration — shortcode widget centering
   Elementor wraps plain shortcode pages in a full-width flex container.
   This makes the widget fill that container so our archive wrappers
   (max-width: var(--kg-max-width); margin: 0 auto) can center correctly.
   ========================================================= */
.elementor-widget-shortcode { width: 100%; }

/* =========================================================
   Typography utilities
   ========================================================= */

.kg-display-title {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
}

/* =========================================================
   Base layout reset for KG post types
   ========================================================= */

.kg-content-area {
    max-width: 100%;
}

/* =========================================================
   Artwork Grid — 4-column shared component
   ========================================================= */

.kg-artwork-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px 24px;
    padding: 0;
}

/* Responsive: 2 columns on tablet, 1 on mobile */
@media (max-width: 1024px) {
    .kg-artwork-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .kg-artwork-grid {
        grid-template-columns: 1fr;
    }
}

.kg-artwork-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.kg-artwork-card__image-wrap {
    position: relative;
    display: block;
    overflow: hidden;
    line-height: 0;
    aspect-ratio: 3 / 4;
    background: var(--kg-color-white);
}

.kg-artwork-card__img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center center;
}

/* =========================================================
   Artwork card hover — white card pop (ludorff-style)
   Desktop/mouse only; touch devices see no effect.
   ========================================================= */

@media (hover: hover) and (pointer: fine) {
    .kg-artwork-card {
        z-index: 0;
        transition: z-index 0s linear .3s;
    }
    .kg-artwork-card::before {
        content: "";
        display: block;
        position: absolute;
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
        background: var(--kg-color-white);
        box-shadow: 0 6px 20px rgba(0, 0, 0, .13);
        border-radius: 2px;
        opacity: 0;
        visibility: hidden;
        transition: opacity .3s ease-out, visibility 0s linear .3s;
        z-index: -1;
    }
    .kg-artwork-card:hover {
        transition-delay: 0s;
        z-index: 2;
    }
    .kg-artwork-card:hover::before {
        opacity: 1;
        visibility: visible;
        transition-delay: 0s, 0s;
    }
    /* Extend white card downward when hover copy exists */
    .kg-artwork-card.has-copy:hover::before { bottom: -54px; }
    /* Hover copy — technique + dimensions */
    .kg-artwork-card__copy {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        padding-top: 6px;
        opacity: 0;
        visibility: hidden;
        transition: opacity .3s ease-out, visibility 0s linear .3s;
    }
    .kg-artwork-card:hover .kg-artwork-card__copy {
        opacity: 1;
        visibility: visible;
        transition-delay: 0s, 0s;
    }
    .kg-artwork-card__copy-technique,
    .kg-artwork-card__copy-dimensions {
        display: block;
        font-size: 11px;
        color: var(--kg-color-subtle);
        line-height: 1.4;
    }
    .kg-artwork-card__copy-dimensions { margin-top: 1px; }
}

/* =========================================================
   Sold badge — shared across grid and detail page
   ========================================================= */

.kg-sold-badge {
    position:       absolute;
    bottom:         0;
    left:           0;
    background:     var(--kg-color-dark);
    color:          var(--kg-color-white);
    font-size:      10px;
    font-family:    inherit;
    letter-spacing: 0.075em;
    border-radius:  2px;
    padding:        3px 6px;
    text-transform: uppercase;
    display:        inline-block;
    line-height:    1;
    pointer-events: none;
}

/* =========================================================
   Artwork card metadata (below thumbnail)
   ========================================================= */

.kg-artwork-card__meta {
    display:        flex;
    flex-direction: column;
    gap:            2px;
    padding-top:    10px;
}

.kg-artwork-card__artist {
    font-size:      11px;
    font-weight:    400;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color:          var(--kg-color-dark);
}

.kg-artwork-card__title {
    font-size:   13px;
    font-weight: 400;
    color:       var(--kg-color-dark);
    line-height: 1.4;
}

.kg-artwork-card__year {
    font-size:   13px;
    font-weight: 300;
    color:       var(--kg-color-mid);
}

/* =========================================================
   Action buttons — artwork detail page
   ========================================================= */

/* Available artwork — solid black "Werk anfragen" button */
.kg-action-btn {
    display:          block;
    width:            100%;
    background:       var(--kg-color-dark);
    color:            var(--kg-color-white);
    border:           none;
    padding:          12px 20px;
    font-size:        13px;
    font-family:      inherit;
    letter-spacing:   0.08em;
    text-transform:   uppercase;
    cursor:           pointer;
    text-align:       center;
    min-height:       44px;
    text-decoration:  none;
    box-sizing:       border-box;
}

.kg-action-btn:hover {
    background: var(--kg-color-dark-hover);
    color:      var(--kg-color-white);
}

/* Sold artwork — greyed out, no interaction */
.kg-action-btn--sold {
    background:     transparent;
    color:          var(--kg-color-sold);
    cursor:         default;
    pointer-events: none;
    border:         1px solid var(--kg-border-sold);
}

.kg-action-btn--sold:hover {
    background: transparent;
    color:      var(--kg-color-sold);
}

/* Editor placeholder for empty widget */
.kg-widget-placeholder {
    padding:    20px;
    background: var(--kg-bg-soft);
    color:      var(--kg-color-faint);
    text-align: center;
    font-size:  13px;
}

/* =========================================================
   PhotoSwipe white-theme override
   Override --pswp-bg (default #000) and icon colors for
   the white gallery aesthetic matching ludorff.com.
   ========================================================= */

.pswp {
    --pswp-bg:                          var(--kg-color-white);
    --pswp-placeholder-bg:              var(--kg-bg-soft);
    --pswp-icon-color:                  var(--kg-color-dark);
    --pswp-icon-color-secondary:        var(--kg-color-mid);
    --pswp-icon-stroke-color:           var(--kg-color-dark);
    --pswp-preloader-color:             rgba(26, 26, 26, 0.4);   /* rgba — cannot use var() here */
    --pswp-preloader-color-secondary:   rgba(26, 26, 26, 0.9);   /* rgba — cannot use var() here */
}

/* Caption text bottom-left inside lightbox */
.kg-pswp-caption {
    position:    absolute;
    bottom:      20px;
    left:        20px;
    font-size:   12px;
    color:       var(--kg-color-mid);
    font-family: inherit;
    line-height: 1.4;
    max-width:   60%;
    pointer-events: none;
}

/* Expand icon trigger in artwork image area */
.kg-artwork-expand-trigger {
    position:   absolute;
    top:        12px;
    right:      12px;
    width:      32px;
    height:     32px;
    display:    flex;
    align-items:     center;
    justify-content: center;
    cursor:     pointer;
    color:      var(--kg-color-dark);
    background: rgba(255, 255, 255, 0.85);
    border:     none;
    padding:    0;
    line-height: 1;
    font-size:  18px;
    z-index:    2;
}

.kg-artwork-expand-trigger:hover {
    background: rgba(255, 255, 255, 1);
}

/* =========================================================
   Artwork Detail Page — two-column layout
   ========================================================= */

.kg-artwork-detail {
    display:   grid;
    grid-template-columns: 38% 62%;
    gap:       0 48px;
    max-width: var(--kg-max-width);
    margin:    0 auto;
    padding:   40px var(--kg-padding-x);
    align-items: start;
}

@media (max-width: 900px) {
    .kg-artwork-detail {
        grid-template-columns: 1fr;
    }
    /* Image column moves below metadata on mobile */
    .kg-artwork-detail__image-col {
        order: -1;
    }
}

/* Metadata column */
.kg-artwork-detail__meta {
    padding-right: var(--kg-padding-x);
}

.kg-artwork-detail__artist {
    font-size:      28px;
    font-weight:    200; /* Very thin — key Ludorff visual signature */
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin:         0 0 6px 0;
    color:          var(--kg-color-dark);
    line-height:    1.1;
}

.kg-artwork-detail__title {
    font-size:   17px;
    font-weight: 400;
    margin:      0 0 2px 0;
    color:       var(--kg-color-dark);
}

.kg-artwork-detail__year {
    font-size:   17px;
    font-weight: 400;
    margin:      0 0 0 0;
    color:       var(--kg-color-dark);
}

.kg-artwork-detail__spacer {
    height: 20px;
}

.kg-artwork-detail__technique,
.kg-artwork-detail__dimensions,
.kg-artwork-detail__werkverz {
    font-size:   13px;
    font-weight: 400;
    color:       var(--kg-color-body);
    margin:      0 0 4px 0;
    line-height: 1.5;
}

.kg-artwork-detail__price {
    font-size:   18px;
    font-weight: 400;
    color:       var(--kg-color-dark);
    margin:      0 0 4px 0;
}

.kg-artwork-detail__price-note {
    font-size:  11px;
    color:      var(--kg-color-faint);
    margin:     0 0 16px 0;
}

.kg-artwork-detail__actions {
    margin: 16px 0;
}

/* Secondary CTA cards */
.kg-artwork-detail__cta-cards {
    display:        flex;
    flex-direction: column;
    gap:            12px;
    margin-top:     16px;
}

.kg-cta-card {
    display:     flex;
    align-items: flex-start;
    gap:         10px;
    padding:     14px 16px;
    background:  var(--kg-bg-card);
    cursor:      pointer;
}

.kg-cta-card__icon {
    font-size:   18px;
    flex-shrink: 0;
    margin-top:  1px;
}

.kg-cta-card__text {
    font-size:   12px;
    color:       var(--kg-color-body);
    margin:      0;
    line-height: 1.5;
}

/* Image column */
.kg-artwork-detail__image-col {
    position: relative;
}

.kg-artwork-detail__image-wrap {
    position: relative;
    display:  block;
}

.kg-artwork-main-image {
    width:      100%;
    height:     auto;
    display:    block;
    cursor:     zoom-in;
}

/* Sub-navigation bar */
.kg-artwork-subnav {
    border-bottom: 1px solid var(--kg-border);
    padding:       10px var(--kg-padding-x);
    background:    var(--kg-color-white);
}

.kg-artwork-subnav__inner {
    display:         flex;
    align-items:     center;
    justify-content: center;
    gap:             16px;
    max-width:       var(--kg-max-width);
    margin:          0 auto;
    font-size:       12px;
    letter-spacing:  0.06em;
}

.kg-artwork-subnav__arrow {
    font-size:       20px;
    color:           var(--kg-color-dark);
    text-decoration: none;
    line-height:     1;
    padding:         0 4px;
}

.kg-artwork-subnav__arrow--disabled {
    color:  var(--kg-border-dim);
    cursor: default;
}

.kg-artwork-subnav__context {
    display:     flex;
    align-items: center;
    gap:         8px;
}

.kg-artwork-subnav__artist {
    font-weight:    400;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color:          var(--kg-color-dark);
}

.kg-artwork-subnav__position {
    color:     var(--kg-color-faint);
    font-size: 11px;
}

/* ---- Artwork Archive Page (/artworks/) ---- */
.kg-artwork-archive { max-width: var(--kg-max-width); margin: 0 auto; padding: 40px var(--kg-padding-x) 80px; }

/* === Phase 8: Artist, Exhibition, and Fair Pages === */

/* ---- A-Z Navigation ---- */
.kg-az-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 48px;
}
.kg-az-nav__letter {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-decoration: none;
    color: var(--kg-color-dark);
    border: 1px solid var(--kg-border);
    transition: background 0.15s, color 0.15s;
}
.kg-az-nav__letter:hover {
    background: var(--kg-color-dark);
    color: var(--kg-color-white);
}
.kg-az-nav__letter--empty {
    color: var(--kg-border-dim);
    border-color: var(--kg-bg-soft);
    cursor: default;
    pointer-events: none;
}

/* ---- Artist Grid (index + related) ---- */
.kg-artist-index { max-width: var(--kg-max-width); margin: 0 auto; padding: 40px var(--kg-padding-x) 80px; }
.kg-artist-group { margin-bottom: 64px; }
.kg-artist-group__heading {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: var(--kg-color-mid);
    text-transform: uppercase;
    border-bottom: 1px solid var(--kg-border);
    padding-bottom: 12px;
    margin-bottom: 24px;
}
.kg-artist-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px 32px;
}
@media (max-width: 900px) {
    .kg-artist-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .kg-artist-grid { grid-template-columns: 1fr; }
}

/* ---- Artist Card ---- */
.kg-artist-card { display: flex; flex-direction: column; }
.kg-artist-card__image-wrap { display: block; overflow: hidden; }
.kg-artist-card__image-wrap img,
.kg-artist-card__img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.kg-artist-card__image-wrap:hover img { transform: scale(1.03); }
.kg-artist-card__img-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--kg-bg-soft);
}
.kg-artist-card__name {
    display: block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--kg-color-dark);
    text-decoration: none;
    margin-top: 12px;
}
.kg-artist-card__name { transition: color 0.2s ease; }
.kg-artist-card__name:hover { color: var(--kg-color-mid); }

/* ---- Artist Detail Page ---- */
.kg-artist-detail { max-width: var(--kg-max-width); margin: 0 auto; padding: 40px var(--kg-padding-x) 80px; }
.kg-artist-detail__header { margin-bottom: 40px; text-align: center; }
.kg-artist-detail__name {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--kg-color-dark);
    margin: 0 0 8px;
}
.kg-artist-detail__subtitle {
    font-size: 14px;
    color: var(--kg-color-mid);
    margin: 0;
    letter-spacing: 0.02em;
}

/* ---- Tabs ---- */
.kg-tabs__nav {
    display: flex;
    gap: 0;
    justify-content: center;
    border-bottom: 1px solid var(--kg-border);
    margin-bottom: 40px;
}
.kg-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px var(--kg-padding-x);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--kg-color-mid);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -1px;
}
.kg-tab-btn:hover { color: var(--kg-color-dark); }
.kg-tab-btn--active {
    color: var(--kg-color-dark);
    border-bottom-color: var(--kg-color-dark);
}
.kg-tab-panel { display: block; }
.kg-tab-panel--hidden { display: none; }
.kg-tab-empty { color: var(--kg-color-faint); font-size: 14px; font-style: italic; }

/* ---- Overview Tab — portrait + bio ---- */
.kg-artist-overview { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; }
@media (max-width: 768px) { .kg-artist-overview { grid-template-columns: 1fr; } }
.kg-artist-overview__image img { width: 100%; display: block; }
.kg-artist-overview__bio h2,
.kg-artist-overview__statement h3 { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--kg-color-mid); margin-bottom: 16px; }
.kg-artist-overview__bio p,
.kg-artist-overview__statement p { font-size: 15px; line-height: 1.7; color: var(--kg-color-dark); }
.kg-artist-overview__video { margin-top: 32px; }
.kg-artist-overview__video video { max-width: 100%; }
.kg-artist-selected-works { margin-top: 48px; }
.kg-artist-selected-exhibitions { margin-top: 56px; }

/* ---- Vita Tab ---- */
.kg-vita-list { margin: 0; padding: 0; list-style: none; }
.kg-vita-row { display: grid; grid-template-columns: 80px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--kg-border-light); }
.kg-vita-row__date { font-size: 13px; font-weight: 500; color: var(--kg-color-mid); }
.kg-vita-row__text { font-size: 14px; color: var(--kg-color-dark); line-height: 1.6; }

/* ---- Exhibitions Tab (artist detail) ---- */
.kg-artist-exhibitions { display: flex; flex-direction: column; gap: 24px; }
.kg-artist-exhibitions .kg-exhibition-item { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; }
@media (max-width: 600px) { .kg-artist-exhibitions .kg-exhibition-item { grid-template-columns: 1fr; } }

/* ---- Related Artists ---- */
.kg-related-artists { margin-top: 80px; padding-top: 40px; border-top: 1px solid var(--kg-border); }
.kg-related-artists__heading { font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--kg-color-mid); margin-bottom: 32px; }

/* ---- Year Filter Pills (shared: exhibition archive + fair archive) ---- */
.kg-year-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 48px;
}
.kg-year-pill {
    display: inline-block;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-decoration: none;
    color: var(--kg-color-dark);
    border: 1px solid var(--kg-border);
    transition: background 0.15s, color 0.15s;
}
.kg-year-pill:hover { background: var(--kg-color-dark); color: var(--kg-color-white); border-color: var(--kg-color-dark); }
.kg-year-pill--active { background: var(--kg-color-dark); color: var(--kg-color-white); border-color: var(--kg-color-dark); }

/* ---- Exhibition Archive ---- */
.kg-exhibition-archive { max-width: var(--kg-max-width); margin: 0 auto; padding: 40px var(--kg-padding-x) 80px; }
.kg-section-heading {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--kg-color-mid);
    margin-bottom: 32px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--kg-border);
}
.kg-exhibition-section { margin-bottom: 64px; }

/* ---- Exhibition Item (archive list: image-left ~40% + meta-right) ---- */
.kg-exhibition-item {
    display: grid;
    grid-template-columns: 40% 1fr;
    gap: 32px;
    align-items: start;
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--kg-border-light);
}
@media (max-width: 768px) { .kg-exhibition-item { grid-template-columns: 1fr; } }
.kg-exhibition-item__image-wrap { display: block; overflow: hidden; }
.kg-exhibition-item__img { width: 100%; display: block; transition: transform 0.3s ease; }
.kg-exhibition-item__image-wrap:hover .kg-exhibition-item__img { transform: scale(1.02); }
.kg-exhibition-item__meta { padding-top: 8px; }
.kg-exhibition-item__title { font-size: 20px; font-weight: 300; color: var(--kg-color-dark); margin-bottom: 8px; }
.kg-exhibition-item__title a { text-decoration: none; color: inherit; transition: color 0.2s ease; }
.kg-exhibition-item__title a:hover { color: var(--kg-color-mid); }
.kg-exhibition-item__dates { font-size: 13px; color: var(--kg-color-mid); margin: 0; letter-spacing: 0.02em; }

/* ---- Exhibition Detail ---- */
.kg-exhibition-detail { max-width: var(--kg-max-width); margin: 0 auto; padding: 40px var(--kg-padding-x) 80px; }

/* Title: full width above the two-column intro */
.kg-exhibition-detail__title {
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 300;
    color: var(--kg-color-dark);
    margin-bottom: 40px;
}

/* Two-column intro: meta left, main image right (Ludorff-style) */
.kg-exhibition-detail__intro {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 48px;
    align-items: start;
    margin-bottom: 64px;
}
/* When no main image: meta takes natural width */
.kg-exhibition-detail__intro:not(.kg-exhibition-detail__intro--has-image) {
    grid-template-columns: 1fr;
}
.kg-exhibition-detail__meta { padding-top: 4px; }
.kg-exhibition-detail__dates { font-size: 14px; color: var(--kg-color-mid); margin: 0 0 8px; line-height: 1.5; }
.kg-exhibition-detail__location-entry { font-size: 14px; color: var(--kg-color-mid); margin-top: 12px; line-height: 1.6; }
.kg-exhibition-detail__location-entry strong { display: block; color: var(--kg-color-dark); margin-bottom: 2px; }
.kg-exhibition-detail__location-entry span { white-space: pre-line; }

/* Main exhibition image */
.kg-exhibition-detail__main-image { overflow: hidden; }
.kg-exhibition-detail__main-image-link { display: block; }
.kg-exhibition-detail__main-img { width: 100%; height: auto; display: block; transition: transform 0.4s ease; }
.kg-exhibition-detail__main-image-link:hover .kg-exhibition-detail__main-img { transform: scale(1.02); }

@media (max-width: 768px) {
    .kg-exhibition-detail__intro { grid-template-columns: 1fr; gap: 32px; }
    .kg-exhibition-detail__main-image { order: -1; } /* image above meta on mobile */
}

/* ---- Exhibition Impressions gallery (lightbox) ---- */
.kg-exhibition-detail__impressions { margin-bottom: 64px; }
.kg-exhibition-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}
.kg-gallery-item { display: block; overflow: hidden; }
.kg-gallery-thumb { width: 100%; height: 260px; object-fit: cover; display: block; transition: transform 0.3s ease; }
.kg-gallery-item:hover .kg-gallery-thumb { transform: scale(1.03); }
@media (max-width: 600px) { .kg-exhibition-gallery { grid-template-columns: 1fr; } .kg-gallery-thumb { height: 220px; } }

.kg-exhibition-detail__description { font-size: 15px; line-height: 1.8; color: var(--kg-color-dark); max-width: 800px; margin-bottom: 64px; }
.kg-exhibition-detail__artworks { margin-bottom: 64px; }
.kg-exhibition-detail__artists { margin-bottom: 64px; }
.kg-exhibition-detail__video { margin-bottom: 64px; }
.kg-exhibition-video { max-width: 100%; width: 100%; }

/* ---- Fair Archive ---- */
.kg-fair-archive { max-width: var(--kg-max-width); margin: 0 auto; padding: 40px var(--kg-padding-x) 80px; }
.kg-fair-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}
@media (max-width: 768px) { .kg-fair-grid { grid-template-columns: 1fr; } }

/* ---- Fair Card ---- */
.kg-fair-card { display: flex; flex-direction: column; }
.kg-fair-card__image-wrap { display: block; overflow: hidden; position: relative; }
.kg-fair-card__img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; transition: transform 0.3s ease; }
.kg-fair-card__image-wrap:hover .kg-fair-card__img { transform: scale(1.03); }
.kg-vorschau-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--kg-color-dark);
    color: var(--kg-color-white);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    padding: 4px 10px;
}
.kg-fair-card__meta { padding-top: 16px; }
.kg-fair-card__name { font-size: 13px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--kg-color-dark); margin-bottom: 4px; }
.kg-fair-card__dates { font-size: 13px; color: var(--kg-color-mid); margin: 0; }

/* ---- Misc ---- */
.kg-archive-empty { color: var(--kg-color-faint); font-size: 14px; font-style: italic; padding: 40px 0; }
.kg-artist-grid--related { grid-template-columns: repeat(3, 1fr); }
.kg-artist-grid--small { grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 768px) {
    .kg-artist-grid--small { grid-template-columns: repeat(3, 1fr); }
    .kg-artist-grid--related { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .kg-artist-grid--small { grid-template-columns: repeat(2, 1fr); }
}

/* === Phase 9: Navigation, Homepage, Contact, Responsive === */

/* Hide WordPress page/post title injected by Hello Elementor (<div class="page-header">) */
.page-header { display: none; }

/* ---- Header ---- */
.kg-header { position: sticky; top: 0; z-index: 100; background: var(--kg-color-white); border-bottom: 1px solid var(--kg-border); height: var(--kg-header-height); }
.kg-header__inner { max-width: var(--kg-max-width); margin: 0 auto; padding: 0 var(--kg-padding-x); display: flex; align-items: center; justify-content: space-between; height: 100%; }
.kg-header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    line-height: 1;
    transition: opacity 0.2s ease;
}
.kg-header__logo:hover {
    opacity: 0.7;
}
.kg-header .kg-header__logo-img {
    height: 60px;
    width: auto;
    display: block;
    object-fit: contain;
    opacity: 1;
}
.kg-header__title {
    font-size: 1.6rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--kg-color-dark);
    margin-left: 14px;
    white-space: nowrap;
}
.kg-header__nav .kg-nav__list { display: flex; list-style: none; margin: 0; padding: 0; gap: 0; }
.kg-header__nav .kg-nav__list li { margin: 0; }
.kg-header__nav .kg-nav__list a { display: block; padding: 8px 16px; font-size: 11px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; color: var(--kg-color-dark); transition: color 0.2s ease; }
.kg-header__nav .kg-nav__list a:hover { color: var(--kg-color-mid); }
.kg-header__nav .kg-nav__list .current-menu-item > a { color: var(--kg-color-mid); }
.kg-burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.kg-burger__bar { display: block; width: 22px; height: 2px; background: var(--kg-color-dark); }
.kg-nav-overlay { display: none; position: fixed; inset: 0; z-index: 200; background: var(--kg-color-white); flex-direction: column; align-items: center; justify-content: center; }
.kg-nav-overlay--open { display: flex; }
.kg-nav-overlay__close { position: absolute; top: 20px; right: var(--kg-padding-x); background: none; border: none; font-size: 24px; cursor: pointer; color: var(--kg-color-dark); line-height: 1; }
.kg-nav-overlay__list { list-style: none; margin: 0; padding: 0; text-align: center; }
.kg-nav-overlay__list li { margin: 16px 0; }
.kg-nav-overlay__list a { font-size: 24px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; color: var(--kg-color-dark); transition: opacity 0.2s ease; }
.kg-nav-overlay__list a:hover { opacity: 0.5; }
.kg-nav-overlay__close { transition: opacity 0.2s ease; }
.kg-nav-overlay__close:hover { opacity: 0.5; }
@media (max-width: 768px) {
    .kg-header__nav { display: none; }
    .kg-burger { display: flex; }
    .kg-header__title { font-size: 1.1rem; margin-left: 10px; }
}

/* ---- Footer ---- */
.kg-footer { background: var(--kg-color-white); margin-top: 80px; }
.kg-footer__main { border-top: 1px solid var(--kg-border); padding: 48px 0 40px; }
.kg-footer__main-inner { max-width: var(--kg-max-width); margin: 0 auto; padding: 0 var(--kg-padding-x); display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; }
.kg-footer__name { font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--kg-color-dark); margin: 0 0 16px; }
.kg-footer__address { font-style: normal; font-size: 12px; line-height: 1.8; color: var(--kg-color-muted); margin: 0 0 16px; }
.kg-footer__address a { color: var(--kg-color-muted); text-decoration: none; transition: color 0.15s ease; }
.kg-footer__address a:hover { color: var(--kg-color-dark); }
.kg-footer__hours { font-size: 12px; line-height: 1.8; color: var(--kg-color-muted); margin: 0; }

/* Footer info box — compact single-column grey block with opening times */
.kg-footer__info-box {
    background: #F5F5F5;
    border-radius: 4px;
    padding: 24px 28px;
    min-width: 200px;
}
.kg-footer__hours-heading {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--kg-color-dark);
    margin: 0 0 10px;
}

.kg-footer__social { display: flex; flex-direction: column; gap: 10px; text-align: right; }
.kg-footer__social-link { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; color: var(--kg-color-subtle); transition: color 0.15s; }
.kg-footer__social-link:hover { color: var(--kg-color-dark); }
.kg-footer__bar { border-top: 1px solid var(--kg-border); padding: 16px 0; }
.kg-footer__bar-inner { max-width: var(--kg-max-width); margin: 0 auto; padding: 0 var(--kg-padding-x); }
.kg-footer__legal { display: flex; gap: 24px; flex-wrap: wrap; }
.kg-footer__legal a { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--kg-color-subtle); transition: color 0.15s ease; }
.kg-footer__legal a:hover { color: var(--kg-color-dark); }
@media (max-width: 768px) {
    .kg-footer__main-inner { flex-direction: column; gap: 32px; }
    .kg-footer__social { text-align: left; }
    .kg-footer__legal { gap: 16px; }
}

/* Footer company legal links */
.kg-footer__company-links {
    margin-top: 12px;
}

.kg-footer__company-links a {
    display: block;
    color: inherit;
    text-decoration: underline;
    font-size: 0.85em;
    opacity: 0.75;
    transition: opacity 0.2s;
    margin-top: 4px;
}

.kg-footer__company-links a:hover {
    opacity: 1;
}

/* ---- Breadcrumb ---- */
.kg-breadcrumb { margin-bottom: 24px; }
.kg-breadcrumb__list { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--kg-color-subtle); }
.kg-breadcrumb__list li { display: flex; align-items: center; }
.kg-breadcrumb__list li + li::before { content: '/'; margin-right: 4px; color: var(--kg-border-dim); }
.kg-breadcrumb__list a { color: var(--kg-color-subtle); text-decoration: none; transition: color 0.15s ease; }
.kg-breadcrumb__list a:hover { color: var(--kg-color-dark); }
.kg-breadcrumb__list [aria-current="page"] { color: var(--kg-color-dark); }

/* ---- Homepage ---- */
.kg-homepage-section { padding: 60px 0; }
.kg-homepage-section + .kg-homepage-section { border-top: 1px solid var(--kg-border); }
.kg-homepage-section__inner { max-width: var(--kg-max-width); margin: 0 auto; padding: 0 var(--kg-padding-x); }
.kg-homepage-section__header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 32px; }
.kg-homepage-section__title { font-size: 11px; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; color: var(--kg-color-subtle); margin: 0 0 32px; }
.kg-homepage-section__header .kg-homepage-section__title { margin-bottom: 0; }
.kg-view-all-link { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; color: var(--kg-color-subtle); border-bottom: 1px solid var(--kg-border-dim); padding-bottom: 1px; transition: color 0.2s ease, border-color 0.2s ease; }
.kg-view-all-link:hover { color: var(--kg-color-dark); border-color: var(--kg-color-dark); }

/* New Works grid (4-column) */
.kg-homepage-new-works .kg-artwork-grid { grid-template-columns: repeat(4, 1fr); gap: 24px 20px; }

/* Responsive: Homepage sections */
@media (max-width: 1024px) {
    .kg-homepage-new-works .kg-artwork-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .kg-homepage-section { padding: 40px 0; }
    .kg-homepage-new-works .kg-artwork-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .kg-homepage-new-works .kg-artwork-grid { grid-template-columns: repeat(1, 1fr); }
}

/* ---- Galerie / Contact Page ---- */

/* Intro */
.kg-galerie-intro { display: grid; grid-template-columns: 3fr 2fr; gap: 48px; margin-bottom: 60px; align-items: start; }
.kg-galerie-intro h2 { font-size: 28px; font-weight: 300; letter-spacing: 0.03em; margin: 0 0 20px; }
.kg-galerie-intro__lead { font-size: 15px; line-height: 1.8; color: var(--kg-color-body); margin: 0; }
.kg-galerie-intro__image-placeholder { background: var(--kg-bg-soft); aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; color: #AAAAAA; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }

/* Value Pillars */
.kg-galerie-pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-bottom: 60px; border-top: 1px solid var(--kg-border); padding-top: 48px; }
.kg-galerie-pillar h3 { font-size: 13px; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; margin: 0 0 16px; }
.kg-galerie-pillar p { font-size: 14px; line-height: 1.7; color: var(--kg-color-muted); margin: 0; }

/* About text */
.kg-galerie-about { max-width: 720px; margin-bottom: 60px; border-top: 1px solid var(--kg-border); padding-top: 48px; }
.kg-galerie-about h2 { font-size: 22px; font-weight: 400; margin: 0 0 24px; }
.kg-galerie-about p { font-size: 15px; line-height: 1.7; color: var(--kg-color-body); margin: 0 0 16px; }

/* Service Cards */
.kg-galerie-services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; border-top: 1px solid var(--kg-border); padding-top: 48px; margin-bottom: 40px; }
.kg-galerie-service h4 { font-size: 12px; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; margin: 0 0 12px; }
.kg-galerie-service p { font-size: 13px; line-height: 1.7; color: var(--kg-color-muted); margin: 0 0 16px; }
.kg-galerie-service__link { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; color: var(--kg-color-dark); border-bottom: 1px solid var(--kg-color-dark); padding-bottom: 1px; transition: color 0.2s ease, border-color 0.2s ease; }
.kg-galerie-service__link:hover { color: var(--kg-color-muted); border-color: var(--kg-color-muted); }

@media (max-width: 1024px) {
    .kg-galerie-intro { grid-template-columns: 1fr; }
    .kg-galerie-intro__image { display: none; }
}
@media (max-width: 768px) {
    .kg-galerie-pillars { grid-template-columns: 1fr; gap: 32px; }
    .kg-galerie-services { grid-template-columns: 1fr; }
}

/* Kontakt: 2-col (form | map+info merged), responsive stack */
.kg-galerie-kontakt { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; max-width: 1200px; margin-left: auto; margin-right: auto; width: 100%; }

.kg-contact-form { }
.kg-contact-form__field { margin-bottom: 20px; }
.kg-contact-form__field label { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--kg-color-subtle); margin-bottom: 6px; }
.kg-contact-form__field input,
.kg-contact-form__field textarea { width: 100%; border: 1px solid var(--kg-border-input); padding: 10px 12px; font-size: 14px; font-family: inherit; color: var(--kg-color-dark); background: var(--kg-color-white); outline: none; box-sizing: border-box; }
.kg-contact-form__field input:focus,
.kg-contact-form__field textarea:focus { border-color: var(--kg-color-dark); }
.kg-contact-form__submit { background: var(--kg-color-dark); color: var(--kg-color-white); border: none; padding: 12px 32px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; transition: background 0.15s; }
.kg-contact-form__submit:hover { background: var(--kg-color-body); }
.kg-contact-form__success { background: #F0F8F0; border: 1px solid #AACCAA; padding: 12px 16px; font-size: 13px; color: #2A6A2A; margin-bottom: 24px; }
.kg-contact-form__error { background: #FFF0F0; border: 1px solid #CCAAAA; padding: 12px 16px; font-size: 13px; color: #6A2A2A; margin-bottom: 24px; }

.kg-galerie-kontakt__info iframe { display: block; width: 100%; margin-bottom: 24px; }
.kg-galerie-kontakt__info address { font-style: normal; font-size: 14px; line-height: 1.8; color: var(--kg-color-body); margin-bottom: 24px; }
.kg-galerie-kontakt__info h3 { font-size: 13px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 16px; }
.kg-galerie-kontakt__info h4 { font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 8px; color: var(--kg-color-subtle); }
.kg-galerie-kontakt__info a { color: var(--kg-color-dark); }
/* Elementor text-editor inside info column */
.kg-galerie-kontakt__info .elementor-widget-text-editor p { font-size: 14px; line-height: 1.8; color: var(--kg-color-body); margin: 0; }

@media (max-width: 900px) {
    .kg-galerie-kontakt { grid-template-columns: 1fr; }
}

/* ================================================================
   Phase 28 — Elementor Container Layout Fixes
   ================================================================ */

/* Elementor containers inside CSS-grid galerie rows shrink to their
   own --width setting (e.g. 33%) rather than filling the grid cell.
   Reset --width so the grid track controls the actual column width. */
.kg-galerie-intro > .e-con,
.kg-galerie-pillars > .e-con,
.kg-galerie-services > .e-con,
.kg-galerie-kontakt > .e-con {
    --width: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Tab panels: add page-level horizontal padding matching Elementor
   section default so content isn't flush to the viewport edge. */
#tab-ueber-uns.e-con,
#tab-kontakt.e-con {
    padding-left: 80px !important;
    padding-right: 80px !important;
    padding-top: 48px !important;
    padding-bottom: 48px !important;
}
@media (max-width: 1024px) {
    #tab-ueber-uns.e-con,
    #tab-kontakt.e-con { padding-left: 40px !important; padding-right: 40px !important; }
}
@media (max-width: 768px) {
    #tab-ueber-uns.e-con,
    #tab-kontakt.e-con { padding-left: 20px !important; padding-right: 20px !important; }
}

/* Image placeholder: Elementor image widget with empty src shows nothing.
   Apply the placeholder styling to the widget container. */
.kg-galerie-intro__image-placeholder .elementor-widget-container {
    background: var(--kg-bg-soft);
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kg-galerie-intro__image-placeholder .elementor-widget-container:empty::before {
    content: 'GALERIE-BILD PLATZHALTER';
    color: #AAAAAA;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Service card link: override Elementor button widget default green bg */
.kg-galerie-service__link .elementor-button,
.kg-galerie-service__link .elementor-button:visited {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    color: var(--kg-color-dark) !important;
    font-size: 11px !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    border-bottom: 1px solid var(--kg-color-dark) !important;
    padding-bottom: 1px !important;
    display: inline !important;
}
.kg-galerie-service__link .elementor-button:hover {
    color: var(--kg-color-muted) !important;
    border-bottom-color: var(--kg-color-muted) !important;
    background: none !important;
}
.kg-galerie-service__link .elementor-button-content-wrapper { display: inline !important; }

/* ---- Responsive Validation (cross-cutting) ---- */
/* Ensure main content wrapper has proper padding on mobile */
@media (max-width: 768px) {
    .kg-page-content { padding: 0 16px; }
}
/* Artwork subnav responsive */
@media (max-width: 600px) {
    .kg-artwork-subnav { flex-direction: column; gap: 8px; text-align: center; }
}

/* === Phase 13: Homepage Hero === */

/* Ludorff-style: contained layout, natural height, gray panel behind content */
.kg-hero {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 80px 0;
}

/* Gray background panel — absolute, starts at ~17% from left, painting overlaps it */
.kg-hero::before {
    content: '';
    position: absolute;
    inset: 0 0 0 17%;
    background: var(--kg-bg-hero);
    z-index: 0;
}

/* Image column — fixed height, painting shown at natural proportions anchored left */
.kg-hero__image-col {
    position: relative;
    z-index: 1;
    flex: 0 0 48%;
    height: 480px;
}

.kg-hero__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: left center;
    border: 1rem solid #fff;
    box-sizing: border-box;
}

/* Text panel — sits on gray panel, vertically centered */
.kg-hero__text-col {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 64px 0 56px;
    background: transparent;
}

.kg-hero__title {
    font-size: clamp(28px, 3.2vw, 52px);
    font-weight: 300;
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--kg-color-dark);
    margin: 0 0 24px;
    line-height: 1.1;
}

.kg-hero__label {
    display: inline-block;
    align-self: flex-start;
    font-size: 10px;
    font-family: inherit;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--kg-color-dark);
    border: 1px solid var(--kg-color-dark);
    padding: 3px 10px;
    margin-bottom: 20px;
}

.kg-hero__dates {
    font-size: 14px;
    color: var(--kg-color-body);
    margin: 0 0 32px;
    letter-spacing: 0.01em;
    line-height: 1.7;
}

.kg-hero__cta {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--kg-color-dark);
    border-bottom: 1px solid var(--kg-color-dark);
    padding-bottom: 2px;
    align-self: flex-start;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.kg-hero__cta:hover {
    color: var(--kg-color-mid);
    border-color: var(--kg-color-mid);
}

/* Spacing between stacked hero blocks */
.kg-hero + .kg-hero {
    margin-top: 40px;
}

/* Reversed hero: image RIGHT, text LEFT, grey panel flipped */
.kg-hero--reversed {
    flex-direction: row-reverse;
}

.kg-hero--reversed::before {
    inset: 0 17% 0 0;   /* panel starts from left, ends at 83% */
}

.kg-hero--reversed .kg-hero__img {
    object-position: right center;
}

.kg-hero--reversed .kg-hero__text-col {
    padding: 0 56px 0 64px;   /* mirror the padding */
}

/* RESP-01: Mobile (< 768px) — stack vertically */
@media (max-width: 767px) {
    .kg-hero {
        flex-direction: column;
        padding: 0;
    }
    .kg-hero::before {
        display: none;
    }
    .kg-hero__image-col {
        width: 100%;
        flex: none;
        height: 280px;
    }
    .kg-hero__img {
        object-position: center center;
    }
    .kg-hero__text-col {
        padding: 32px var(--kg-padding-x);
        background: var(--kg-bg-hero);
    }
    .kg-hero__title {
        font-size: clamp(22px, 6vw, 32px);
    }
    .kg-hero--reversed {
        flex-direction: column;   /* stack vertically on mobile, same as normal */
    }
    .kg-hero + .kg-hero {
        margin-top: 24px;
    }
}

/* RESP-02: Tablet (768px–1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .kg-hero {
        padding: 48px 0;
    }
    .kg-hero__image-col {
        height: 360px;
    }
    .kg-hero__text-col {
        padding: 0 40px 0 40px;
    }
    .kg-hero + .kg-hero {
        margin-top: 32px;
    }
}

/* =========================================================
   Artist Detail — Ludorff-style redesign
   Big centred header · narrow bio column · left-aligned tabs
   ========================================================= */

/* 1. More air above the name */
.kg-artist-detail {
    padding-top: 100px;
}

/* 2. Header — enlarged name, generous whitespace */
.kg-artist-detail__header {
    margin-bottom: 72px;
}

.kg-artist-detail__name {
    font-size: clamp(48px, 7vw, 80px);
    font-weight: 200;
    letter-spacing: 0.06em;
    margin: 0 0 16px;
}

.kg-artist-detail__subtitle {
    font-size: 16px;
    letter-spacing: 0.02em;
}

/* 3. Tabs — centred, more space below */
.kg-artist-detail .kg-tabs__nav {
    justify-content: center;
    margin-bottom: 56px;
}

.kg-artist-detail .kg-tab-btn {
    padding: 16px 28px;
    font-size: 13px;
}

/* 4. Overview — no portrait, single narrow bio column */
.kg-artist-overview {
    display: block;
}

.kg-artist-overview__image {
    display: none;
}

.kg-artist-overview__bio {
    max-width: 680px;
    margin: 0 auto;
}

.kg-artist-overview__bio p {
    font-size: 17px;
    line-height: 1.85;
    color: var(--kg-color-dark);
}

/* 5. Section headings — large, light, not uppercase */
.kg-artist-detail .kg-section-heading {
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 300;
    letter-spacing: 0;
    text-transform: none;
    color: var(--kg-color-dark);
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 40px;
}

/* 6. More breathing room above selected works/exhibitions */
.kg-artist-selected-works,
.kg-artist-selected-exhibitions {
    margin-top: 96px;
}

/* 7. Mobile — tighten up */
@media (max-width: 768px) {
    .kg-artist-detail {
        padding-top: 48px;
    }
    .kg-artist-detail__header {
        margin-bottom: 40px;
    }
    .kg-artist-detail .kg-tabs__nav {
        margin-bottom: 32px;
    }
    .kg-artist-detail .kg-tab-btn {
        padding: 12px 16px;
        font-size: 12px;
    }
    .kg-artist-overview__bio p {
        font-size: 15px;
    }
    .kg-artist-selected-works,
    .kg-artist-selected-exhibitions {
        margin-top: 56px;
    }
}

/* === Phase 17: Custom Sections Renderer === */

/* Outer wrapper — encloses all section rows for a single post's custom sections */
.kg-custom-sections {
    width: 100%;
}

/* Each section row: CSS grid; columns configured per-row via --kg-section-cols custom property.
   Using inline CSS custom property (not inline grid-template-columns) so the mobile media query
   can override --kg-section-cols: 1fr without requiring !important on grid-template-columns.
   Gap and padding driven by modifier custom properties set by kg-gap-* and kg-pad-* classes. */
.kg-section {
    display: grid;
    grid-template-columns: var(--kg-section-cols, 1fr);
    gap: var(--kg-section-gap, 0 32px);
    width: 100%;
    padding: var(--kg-section-pad-y, 40px) var(--kg-section-inset, 0);
    background: var(--kg-section-bg, transparent);
    color: var(--kg-section-color, inherit);
}

/* Column cell — min-width: 0 prevents CSS Grid blowout from long unbreakable content */
.kg-col {
    min-width: 0;
}

/* Images inside columns — fill column width, height and fit controlled by preset custom properties */
.kg-col img.kg-section-img {
    display: block;
    width: 100%;
    height: var(--kg-col-img-h, auto);
    object-fit: var(--kg-col-img-fit, cover);
    object-position: center center;
}

/* WYSIWYG text wrapper — inherits preset color via cascade (important for Dark preset) */
.kg-section-text {
    /* Font inherits from theme body typography per spec — no overrides here */
}

/* --- Padding modifiers --- */

.kg-pad-none     { --kg-section-pad-y: 0px; }
.kg-pad-tight    { --kg-section-pad-y: 16px; }
.kg-pad-normal   { --kg-section-pad-y: 40px; }
.kg-pad-spacious { --kg-section-pad-y: 72px; }

/* --- Gap modifiers --- */

.kg-gap-none   { --kg-section-gap: 0; }
.kg-gap-small  { --kg-section-gap: 0 16px; }
.kg-gap-medium { --kg-section-gap: 0 32px; }
.kg-gap-large  { --kg-section-gap: 0 64px; }

/* --- Content padding (horizontal inset) modifiers --- */

.kg-inset-none { --kg-section-inset: 0; }
.kg-inset-sm   { --kg-section-inset: 16px; }
.kg-inset-md   { --kg-section-inset: 32px; }
.kg-inset-lg   { --kg-section-inset: 64px; }
.kg-inset-xl   { --kg-section-inset: 96px; }

/* --- Background modifiers ---
   Pure CSS only — no image assets.
   Dark backgrounds also flip text color via --kg-section-color.
   Image height/fit overrides applied per-background where appropriate.
   ----------------------------------------------------------------- */

/* Museum white: near-neutral warm white, classic gallery paper tone */
.kg-bg-white       { --kg-section-bg: #ffffff; }

/* Museum off-white: the warm neutral used for exhibition wall labels */
.kg-bg-offwhite    { --kg-section-bg: #f5f5f3; }

/* Warm gallery: beige-tinged white, cognac-print catalogue warmth */
.kg-bg-warm        { --kg-section-bg: #f0ede8; }

/* Linen texture: subtle diagonal canvas weave via CSS repeating gradient */
.kg-bg-linen {
    --kg-section-bg: #f2ede7;
    background-image: repeating-linear-gradient(
        45deg,
        rgba(0,0,0,0.018) 0px,
        rgba(0,0,0,0.018) 1px,
        transparent 1px,
        transparent 6px
    ),
    repeating-linear-gradient(
        -45deg,
        rgba(0,0,0,0.012) 0px,
        rgba(0,0,0,0.012) 1px,
        transparent 1px,
        transparent 6px
    );
}

/* Charcoal gallery wall: mid-dark, museum-style painted concrete */
.kg-bg-charcoal {
    --kg-section-bg:    #2e2e2e;
    --kg-section-color: #e8e4df;
    --kg-col-img-h:     420px;
    --kg-col-img-fit:   cover;
}

/* Near-black: deep dark gallery, maximum drama */
.kg-bg-near-black {
    --kg-section-bg:    #1A1A1A;
    --kg-section-color: #f0ece7;
    --kg-col-img-h:     420px;
    --kg-col-img-fit:   cover;
}

/* Spotlight: gallery ceiling spot — radial warm cone from top-center on charcoal */
.kg-bg-spotlight {
    --kg-section-bg:    #1e1e1e;
    --kg-section-color: #f0ece7;
    --kg-col-img-h:     440px;
    --kg-col-img-fit:   cover;
    background-image: radial-gradient(
        ellipse 70% 60% at 50% -10%,
        rgba(255, 230, 160, 0.22) 0%,
        rgba(255, 200, 100, 0.08) 40%,
        transparent 70%
    );
}

/* Night gallery: near-black with faint warm vignette at edges — intimate viewing mood */
.kg-bg-night {
    --kg-section-bg:    #0d0d0f;
    --kg-section-color: #d9d4cc;
    --kg-col-img-h:     460px;
    --kg-col-img-fit:   cover;
    background-image: radial-gradient(
        ellipse 120% 100% at 50% 50%,
        rgba(60, 40, 20, 0.35) 0%,
        transparent 65%
    );
}

/* Concrete plaster: textured grey found in contemporary art spaces */
.kg-bg-concrete {
    --kg-section-bg:    #cac8c5;
    --kg-section-color: #1a1a1a;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(255,255,255,0.04) 0px,
            rgba(255,255,255,0.04) 1px,
            transparent 1px,
            transparent 4px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(0,0,0,0.025) 0px,
            rgba(0,0,0,0.025) 1px,
            transparent 1px,
            transparent 4px
        );
}

/* Transparent: content sits on page background (default page color shows through) */
.kg-bg-transparent { --kg-section-bg: transparent; }

/* Mobile: stack all columns to single column (RENDER-04).
   Breakpoint: 767px consistent with existing kg-frontend.css pattern.
   !important required: --kg-section-cols is set as an inline style by the renderer,
   which has higher specificity than media queries. !important is the correct fix here. */
@media (max-width: 767px) {
    .kg-section {
        --kg-section-cols: 1fr !important;
        --kg-section-gap:  24px 0;
    }
}

/* Lightbox trigger anchor — wraps images in custom sections */
.kg-cs-photo {
    display: block;
    cursor: zoom-in;
}

/* =========================================================
   Page Transitions — gallery-wall white wipe (PHASE 19)
   Full-viewport white overlay injected by kg-transitions.js.
   opacity: 0 = invisible (pointer-events: none so clicks pass through)
   opacity: 1 = full white screen (pointer-events: auto blocks interaction)
   Transition timing: 200ms out + 200ms in = 400ms total (≤ 500ms TRANS-02)
   ========================================================= */

#kg-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--kg-color-white);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
    will-change: opacity;
}

#kg-overlay.kg-overlay--active {
    opacity: 1;
    pointer-events: auto;
}

/* =========================================================
   Image Fade-In — scroll-triggered opacity entrance (PHASE 20)
   All img elements start invisible; .kg-img--visible reveals them.
   Above-fold images are marked .kg-img--visible synchronously by
   kg-image-fade.js before the IntersectionObserver attaches,
   so they are never invisible on page load (ANIM-02).
   Duration: 400ms — matches Phase 19 transition timing philosophy.
   No translate — pure opacity avoids layout shift in gallery context (ANIM-03).
   ========================================================= */

img {
    opacity: 0;
    transition: opacity 400ms ease;
}

img.kg-img--visible {
    opacity: 1;
}

/* PhotoSwipe creates <img> elements dynamically — they are never seen
   by the DOMContentLoaded IntersectionObserver, so they must be
   exempt from the global opacity-0 rule.
   !important guards against Elementor widget rules that could override. */
.pswp img {
    opacity: 1 !important;
    transition: none;
}

/* Bug fix: during the opening zoom animation PhotoSwipe starts .pswp at
   opacity: 0.003 and fades to 1. With --pswp-bg: white this looks like a
   white screen before the image appears. Fix: make the container immediately
   opaque once opened. .pswp--closing exempts the close animation so it
   still fades out normally (PhotoSwipe adds that class at close start). */
.pswp--open:not(.pswp--closing) {
    opacity: 1;
}

/* =========================================================
   Phase 22: Typography & Spacing
   Append-only overrides — no existing rules modified.
   Fixes: heading hierarchy, letter-spacing, body rhythm,
   metadata visual distinction across all detail page types.
   ========================================================= */

/* Fix 1 — Exhibition detail title: add uppercase register and tracking (TYPE-01, TYPE-02) */
.kg-exhibition-detail__title {
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Fix 2 — Exhibition archive item title: add minimal tracking (TYPE-02) */
.kg-exhibition-item__title {
    letter-spacing: 0.04em;
}

/* Fix 3 — Artist detail section headings: override explicit zero tracking (TYPE-02) */
.kg-artist-detail .kg-section-heading {
    letter-spacing: 0.03em;
}

/* Fix 4 — Artwork detail title and year: add tracking; year gets metadata colour (TYPE-02, TYPE-04) */
.kg-artwork-detail__title {
    letter-spacing: 0.02em;
}
.kg-artwork-detail__year {
    letter-spacing: 0.02em;
    color: var(--kg-color-mid);
}

/* Fix 5 — Artwork technique/dimensions/werkverz: establish metadata tier (TYPE-04) */
.kg-artwork-detail__technique,
.kg-artwork-detail__dimensions,
.kg-artwork-detail__werkverz {
    color: var(--kg-color-mid);
    font-size: 12px;
    letter-spacing: 0.03em;
    line-height: 1.6;
    margin: 0 0 6px 0;
}

/* Fix 6 — Vita date column: reduce weight from 500 to 400; metadata should not outweigh entry text (TYPE-04) */
.kg-vita-row__date {
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.03em;
}

/* Fix 7 — Exhibition dates: expand compressed line-height for multi-line date ranges (TYPE-03) */
.kg-exhibition-detail__dates {
    line-height: 1.65;
}

/* =========================================================
   Werkanfrage modal — artwork inquiry popup
   ========================================================= */

.kg-anfrage-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.kg-anfrage-overlay[aria-hidden="true"] {
    display: none;
}

.kg-anfrage-modal {
    background: var(--kg-color-white);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px 36px 32px;
    position: relative;
    box-sizing: border-box;
}

.kg-anfrage-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: var(--kg-color-subtle);
    padding: 4px 8px;
}
.kg-anfrage-modal__close:hover {
    color: var(--kg-color-dark);
}

.kg-anfrage-modal__title {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0 0 24px;
    text-align: center;
}

/* Artwork preview row */
.kg-anfrage-modal__artwork {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--kg-border);
}
.kg-anfrage-modal__thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    flex-shrink: 0;
}
.kg-anfrage-modal__artwork-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
}
.kg-anfrage-modal__artist {
    font-size: 13px;
    font-weight: 500;
    color: var(--kg-color-dark);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.kg-anfrage-modal__artwork-title {
    font-size: 14px;
    font-style: italic;
    color: var(--kg-color-body);
}
.kg-anfrage-modal__artwork-meta {
    font-size: 13px;
    color: var(--kg-color-mid);
}

/* Form fields — reuse contact form conventions */
.kg-anfrage-form__field {
    margin-bottom: 20px;
}
.kg-anfrage-form__field label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--kg-color-subtle);
    margin-bottom: 6px;
}
.kg-anfrage-form__field input,
.kg-anfrage-form__field textarea {
    width: 100%;
    border: 1px solid var(--kg-border-input);
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--kg-color-dark);
    background: var(--kg-color-white);
    outline: none;
    box-sizing: border-box;
}
.kg-anfrage-form__field input:focus,
.kg-anfrage-form__field textarea:focus {
    border-color: var(--kg-color-dark);
}

.kg-anfrage-form__actions {
    margin-top: 4px;
}

.kg-anfrage-form__submit {
    display: block;
    width: 100%;
    background: var(--kg-color-dark);
    color: var(--kg-color-white);
    border: 1px solid var(--kg-color-dark);
    padding: 12px 20px;
    font-size: 12px;
    font-family: inherit;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    min-height: 44px;
    box-sizing: border-box;
}
.kg-anfrage-form__submit:hover {
    background: var(--kg-color-dark-hover);
}
.kg-anfrage-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.kg-anfrage-form__status {
    margin-top: 16px;
    font-size: 13px;
}
.kg-anfrage-form__status:empty {
    display: none;
}
.kg-anfrage-form__status--success {
    background: #F0F8F0;
    border: 1px solid #AACCAA;
    padding: 12px 16px;
    color: #2A6A2A;
}
.kg-anfrage-form__status--error {
    background: #FFF0F0;
    border: 1px solid #CCAAAA;
    padding: 12px 16px;
    color: #6A2A2A;
}

.kg-anfrage-form__privacy {
    margin-top: 20px;
    font-size: 11px;
    color: var(--kg-color-faint);
    line-height: 1.6;
    text-align: center;
}
.kg-anfrage-form__privacy a {
    color: var(--kg-color-subtle);
    text-decoration: underline;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .kg-anfrage-modal {
        padding: 32px 20px 24px;
    }
    .kg-anfrage-modal__thumb {
        width: 60px;
        height: 60px;
    }
}

/* ──────────────────────────────────────────────
   News Archive
   ────────────────────────────────────────────── */
.kg-news-archive {
    max-width: var(--kg-max-width);
    margin: 0 auto;
    padding: 40px var(--kg-padding-x);
}

.kg-news-section {
    margin-bottom: 48px;
}

.kg-news-item {
    display: grid;
    grid-template-columns: 40% 1fr;
    gap: 32px;
    padding: 32px 0;
    border-bottom: 1px solid var(--kg-border-light);
}

.kg-news-item:first-child {
    padding-top: 0;
}

.kg-news-item__image-wrap {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--kg-bg-soft);
}

.kg-news-item__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kg-news-item__meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.kg-news-item__date {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--kg-color-mid);
    margin: 0;
}

.kg-news-item__title {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.3;
    margin: 0;
}

.kg-news-item__title a {
    color: var(--kg-color-dark);
    text-decoration: none;
}

.kg-news-item__title a:hover {
    color: var(--kg-color-dark-hover);
}

.kg-news-item__subtitle {
    font-size: 14px;
    color: var(--kg-color-body);
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .kg-news-item {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ──────────────────────────────────────────────
   News Detail (matches exhibition-detail aesthetic)
   ────────────────────────────────────────────── */
.kg-news-detail {
    max-width: var(--kg-max-width);
    margin: 0 auto;
    padding: 40px var(--kg-padding-x) 80px;
}

/* Title — matches exhibition title: light weight, responsive clamp */
.kg-news-detail__header {
    margin-bottom: 40px;
}

.kg-news-detail__title {
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 300;
    color: var(--kg-color-dark);
    margin: 0;
}

/* Two-column intro: meta left (280px), image right — mirrors exhibition intro */
.kg-news-detail__intro {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: start;
    margin-bottom: 64px;
}

.kg-news-detail__intro--has-image {
    grid-template-columns: 280px 1fr;
}

.kg-news-detail__meta {
    padding-top: 4px;
}

.kg-news-detail__date {
    font-size: 14px;
    color: var(--kg-color-mid);
    margin: 0 0 16px;
    line-height: 1.5;
}

.kg-news-detail__subtitle {
    font-size: 15px;
    font-weight: 400;
    color: var(--kg-color-body);
    line-height: 1.6;
    margin: 0;
}

/* Main image — matches exhibition main image */
.kg-news-detail__image {
    overflow: hidden;
}

.kg-news-detail__img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.kg-news-detail__image:hover .kg-news-detail__img {
    transform: scale(1.02);
}

/* Description — matches exhibition description */
.kg-news-detail__description {
    font-size: 15px;
    line-height: 1.8;
    color: var(--kg-color-dark);
    max-width: 800px;
    margin-bottom: 64px;
}

.kg-news-detail__description p {
    margin: 0 0 1.2em;
}

.kg-news-detail__description p:last-child {
    margin-bottom: 0;
}

/* Video section — matches exhibition section spacing */
.kg-news-detail__video {
    margin-bottom: 64px;
}

.kg-news-detail__video-player {
    width: 100%;
    max-width: 100%;
    display: block;
    background: var(--kg-color-dark);
}

/* Back link */
.kg-news-detail__back {
    padding-top: 40px;
    border-top: 1px solid var(--kg-border);
}

.kg-news-detail__back-link {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--kg-color-dark);
    text-decoration: none;
    transition: color 0.15s;
}

.kg-news-detail__back-link:hover {
    color: var(--kg-color-dark-hover);
}

@media (max-width: 768px) {
    .kg-news-detail__intro--has-image {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .kg-news-detail__image {
        order: -1;  /* image above meta on mobile */
    }

    .kg-news-detail {
        padding-bottom: 60px;
    }
}
