/**
 * Single Wine Page Styles
 * Consistent with wine-list.css variables and styling
 */

/* ========================================
   CSS Variables (inherit from wine-list)
   ======================================== */

:root {
    --wine-bg: linear-gradient(180deg, #F5F3EF 0%, #FFFFFF 50%, #F5F3EF 100%);
    --wine-text: #1F2937;
    --wine-text-muted: #64748B;
    --wine-text-light: #9CA3AF;
    --wine-accent: #C9A227;
    --wine-accent-bg: rgba(201, 162, 39, 0.1);
    --wine-card-bg: rgba(255, 255, 255, 0.8);
    --wine-card-border: rgba(0, 0, 0, 0.08);
    --wine-input-bg: rgba(0, 0, 0, 0.03);
    --wine-shadow: rgba(0, 0, 0, 0.1);
    --wine-image-bg: rgba(0, 0, 0, 0.1);
}

.dark-mode .greco-wine-single,
[data-theme="dark"] .greco-wine-single {
    --wine-bg: linear-gradient(180deg, #1a2535 0%, #243347 50%, #2e3f55 100%);
    --wine-text: #f0f0f0;
    --wine-text-muted: rgba(255, 255, 255, 0.72);
    --wine-text-light: rgba(255, 255, 255, 0.5);
    --wine-accent: #D4AF37;
    --wine-accent-bg: rgba(212, 175, 55, 0.2);
    --wine-card-bg: rgba(255, 255, 255, 0.08);
    --wine-card-border: rgba(255, 255, 255, 0.12);
    --wine-input-bg: rgba(255, 255, 255, 0.08);
    --wine-shadow: rgba(0, 0, 0, 0.25);
    --wine-image-bg: #3f4f5f;
}

/* ========================================
   Wrapper with Hero Background
   ======================================== */

.greco-wine-single {
    position: relative;
    min-height: 100vh;
    padding-top: 90px;
    padding-bottom: 4rem;
}

.greco-wine-single.menu-hero--photo {
    background: transparent;
    /* Override menu.css .menu-hero--photo (display:flex; center align), which
       gets loaded on this page only when pairings are present (for the dish
       modal CSS). Without these overrides the wine layout collapses into a
       centered flex column with the back-link floating mid-page. */
    display: block;
    align-items: initial;
    justify-content: initial;
    min-height: 100vh;
    margin-bottom: 0;
    overflow: visible;
}

.greco-wine-single > .menu-hero__bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    z-index: 0;
    background-size: cover;
    background-position: center 40%;
    background-repeat: no-repeat;
    transition: background-image 0.5s ease;
}

.greco-wine-single > .wine-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    z-index: 1;
    background: linear-gradient(
        180deg,
        rgba(10, 31, 51, 0.65) 0%,
        rgba(10, 31, 51, 0.55) 30%,
        rgba(10, 31, 51, 0.70) 60%,
        rgba(10, 31, 51, 0.85) 100%
    );
}

.dark-mode .greco-wine-single > .wine-hero-overlay,
[data-theme="dark"] .greco-wine-single > .wine-hero-overlay {
    background: linear-gradient(
        180deg,
        rgba(10, 25, 40, 0.55) 0%,
        rgba(10, 25, 40, 0.45) 30%,
        rgba(10, 25, 40, 0.60) 60%,
        rgba(10, 25, 40, 0.78) 100%
    );
}

.greco-wine-single > *:not(.menu-hero__bg):not(.wine-hero-overlay) {
    position: relative;
    z-index: 2;
}

/* ========================================
   Navigation / Back Link
   ======================================== */

.wine-single-nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.5rem 2rem 1rem;
}

.wine-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.wine-back-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-3px);
}

.wine-back-link svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.wine-back-link:hover svg {
    transform: translateX(-2px);
}

/* ========================================
   Main Content Layout
   ======================================== */

.wine-single-content {
    display: flex;
    flex-direction: row;
    max-width: 1100px;
    margin: 1rem auto 0;
    padding: 0 2rem;
    gap: 3rem;
    align-items: flex-start;
}

/* ========================================
   Image Section
   ======================================== */

.wine-single-image {
    position: relative;
    flex: 0 0 380px;
    background: var(--wine-image-bg);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    min-height: 450px;
    backdrop-filter: blur(10px);
}

.wine-single-image img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.4));
}

.wine-single-image .wine-bottle-placeholder {
    color: var(--wine-text-light);
}

/* Supplier logo in image */
.wine-single-supplier {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.wine-single-supplier:hover {
    opacity: 1;
}

.wine-single-supplier .wine-single-supplier-logo {
    height: 80px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.wine-single-supplier:hover .wine-single-supplier-logo {
    opacity: 1;
}

/* ========================================
   Info Section
   ======================================== */

.wine-single-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-top: 0.5rem;
}

/* Badges */
.wine-single-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wine-single-badges .wine-color-badge,
.wine-single-badges .wine-dryness-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Name */
.wine-single-name {
    font-size: 2.25rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

/* Description */
.wine-single-desc {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    line-height: 1.7;
}

.wine-single-desc p {
    margin: 0 0 0.75rem;
}

.wine-single-desc p:last-child {
    margin-bottom: 0;
}

/* Prices */
.wine-single-prices {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
    padding: 0;
}

.wine-single-price {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.wine-single-price .label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.05em;
}

.wine-single-price .label .volume {
    font-weight: 400;
    opacity: 0.8;
}

.wine-single-price .value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--wine-accent);
}

/* Wine Details Table */
.wine-single-details {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 1.25rem;
}

.wine-details-heading {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--wine-accent);
    margin: 0 0 0.75rem;
}

.wine-details-list {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 2rem;
}

.wine-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.wine-detail-row:nth-last-child(-n+2) {
    border-bottom: none;
}

.wine-detail-row dt {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    margin-right: 0.75rem;
    white-space: nowrap;
}

.wine-detail-row dd {
    margin: 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-align: right;
}

/* Buy Button (reuse wine-list styling) */
.greco-wine-single .wine-buy-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, #C9A227 0%, #A8850E 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(201, 162, 39, 0.3);
    width: fit-content;
}

.greco-wine-single .wine-buy-button:hover {
    background: linear-gradient(135deg, #D4AF37 0%, #B8951E 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 162, 39, 0.4);
}

.greco-wine-single .wine-buy-button svg {
    flex-shrink: 0;
}


/* ========================================
   Responsive
   ======================================== */

@media (max-width: 900px) {
    .wine-single-content {
        flex-direction: column;
        padding: 0 1.5rem;
        gap: 2rem;
    }

    .wine-single-image {
        flex: none;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        min-height: 300px;
        padding: 2rem;
    }

    .wine-single-image img {
        max-height: 350px;
    }

    .wine-single-name {
        font-size: 1.75rem;
    }

    .wine-single-nav {
        padding: 1rem 1.5rem 0.5rem;
    }
}

@media (max-width: 600px) {
    .greco-wine-single {
        padding-top: 75px;
        padding-bottom: 3rem;
    }

    .wine-single-content {
        padding: 0 1rem;
        gap: 1.5rem;
    }

    .wine-single-image {
        max-width: 300px;
        min-height: 250px;
        padding: 1.5rem;
    }

    .wine-single-image img {
        max-height: 280px;
    }

    .wine-single-supplier-logo {
        height: 50px;
    }

    .wine-single-name {
        font-size: 1.5rem;
    }

    .wine-single-desc {
        font-size: 0.9rem;
    }

    .wine-single-prices {
        gap: 1.5rem;
    }

    .wine-single-price .value {
        font-size: 1.25rem;
    }

    .wine-details-list {
        grid-template-columns: 1fr;
    }

    .wine-single-nav {
        padding: 0.75rem 1rem 0.5rem;
    }

    .wine-back-link {
        font-size: 0.8rem;
    }
}

/* ========================================
   Transparent Header (single-wine)
   Same pattern as page-wina
   ======================================== */

body.single-wine {
    padding-top: 0 !important;
}

body.single-wine .wp-site-blocks > * {
    margin-block-start: 0 !important;
}

body.single-wine .wp-site-blocks {
    gap: 0 !important;
}

body.single-wine .site-main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.single-wine .site-main > * {
    margin-block-start: 0 !important;
}

/* Transparent header before scroll */
body.single-wine .site-header:not(.header-scrolled) {
    background: transparent !important;
    box-shadow: none;
    border-bottom-color: transparent;
}

body.single-wine .site-header:not(.header-scrolled) .header-wrapper {
    background: transparent !important;
    background-color: transparent !important;
}

body.single-wine .site-header:not(.header-scrolled) .site-logo {
    filter: brightness(0) invert(1);
}

body.single-wine .site-header:not(.header-scrolled) .main-navigation .menu-item > a:not(.sub-menu a),
body.single-wine .site-header:not(.header-scrolled) .nav-menu > li > a,
body.single-wine .site-header:not(.header-scrolled) .nav-menu > li > .menu-item-label {
    color: #FFFFFF;
}

body.single-wine .site-header:not(.header-scrolled) .nav-menu > li > a:hover,
body.single-wine .site-header:not(.header-scrolled) .nav-menu > li > .menu-item-label:hover {
    color: rgba(255, 255, 255, 0.7);
}

body.single-wine .site-header:not(.header-scrolled) .dropdown-trigger {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

body.single-wine .site-header:not(.header-scrolled) .dropdown-icon,
body.single-wine .site-header:not(.header-scrolled) .dropdown-chevron {
    color: #FFFFFF;
}

body.single-wine .site-header:not(.header-scrolled) .dropdown-text {
    color: #FFFFFF;
}

body.single-wine .site-header:not(.header-scrolled) .theme-toggle {
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.25);
}

body.single-wine .site-header:not(.header-scrolled) .mobile-menu-toggle {
    color: #FFFFFF;
}

/* Scrolled header — solid background */
body.single-wine .site-header.header-scrolled {
    background: rgba(255, 255, 255, 0.97) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dark-mode body.single-wine .site-header.header-scrolled,
body.dark-mode.single-wine .site-header.header-scrolled {
    background: var(--greco-surface-overlay) !important;
    box-shadow: 0 1px 3px var(--greco-shadow);
}


/* ============================================
   Producer logo (wine_producer taxonomy)
   ============================================ */
.wine-producer-logo-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s, box-shadow 0.2s;
}

.wine-producer-logo-wrapper svg,
.wine-producer-logo-wrapper img {
    width: auto;
    height: auto;
    transition: opacity 0.2s;
}

.wine-producer-logo-wrapper:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

/* Biały logo → ciemny kontener, invert do bieli */
.wine-producer-logo-wrapper.logo-white {
    background: rgba(20, 20, 20, 0.88);
}

.wine-producer-logo-wrapper.logo-white svg,
.wine-producer-logo-wrapper.logo-white img {
    filter: brightness(0) invert(1);
}

.wine-producer-logo-inner {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

/* Single — absolute lewy górny róg lewej kolumny */
.wine-producer--single {
    position: absolute;
    top: 1rem;
    left: 1rem;
    margin: 0;
    z-index: 3;
}

.wine-producer--single svg,
.wine-producer--single img {
    max-height: 56px;
    max-width: 140px;
}

@media (max-width: 768px) {
    .wine-producer--single {
        top: 0.75rem;
        left: 0.75rem;
        /* position: absolute z reguły powyżej — nie nadpisywać! */
    }

    .wine-producer--single svg,
    .wine-producer--single img {
        max-height: 44px;
        max-width: 110px;
    }
}

/* =====================================================================
   Culinary suggestions (paired dishes)
   Rendered over the hero overlay, so colors mirror .wine-single-desc /
   .wine-details-heading (white/accent on dark) — NOT --wine-text.
   ===================================================================== */
.wine-pairings-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.wine-pairings-heading {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--wine-accent);
    margin: 0 0 0.75rem;
}

.wine-pairings-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.6rem;
}

.wine-pairings-item {
    margin: 0;
}

.greco-paired-dish {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--wine-accent);
    color: rgba(255, 255, 255, 0.92);
    font: inherit;
    font-size: 0.92rem;
    line-height: 1.2;
    padding: 0.5rem 0.95rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
    text-align: left;
}

.greco-paired-dish:hover,
.greco-paired-dish:focus-visible {
    background-color: var(--wine-accent);
    color: #1a1a1a;
    box-shadow: 0 4px 12px rgba(201, 162, 39, 0.35);
    transform: translateY(-1px);
}

.greco-paired-dish:focus-visible {
    outline: 2px solid var(--wine-accent);
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .wine-pairings-list {
        gap: 0.4rem;
    }
    .greco-paired-dish {
        font-size: 0.88rem;
        padding: 0.45rem 0.85rem;
    }
}
