/* ==========================================================================
   DIVINO TEATRO — Etyeki Szőlőbirtok
   Design inspired by Italian Renaissance manuscripts, Tuscan frescoes,
   and the golden warmth of Caravaggio's chiaroscuro.
   ========================================================================== */

/* --- Palette & Variables --- */
:root {
    --parchment:     #f5e6c8;
    --parchment-dark:#e8d5a8;
    --ink:           #2c1810;
    --ink-light:     #5a3a28;
    --terracotta:    #c4572a;
    --terracotta-glow: #d4764a;
    --gold:          #b8860b;
    --gold-light:    #d4a843;
    --olive:         #5c6b3c;
    --olive-dark:    #3a4427;
    --wine:          #722f37;
    --wine-deep:     #4a1a20;
    --sky:           #8fa4b8;
    --fresco-blue:   #4a6a7a;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    background-color: var(--parchment);
    color: var(--ink);
    line-height: 1.8;
    font-size: 18px;
    overflow-x: hidden;

    /* Parchment texture via CSS */
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(196,87,42,0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(184,134,11,0.05) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(92,107,60,0.04) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/* --- Floating Corner Ornaments --- */
.ornament {
    position: fixed;
    font-size: 2.5rem;
    color: var(--gold);
    opacity: 0.25;
    z-index: 100;
    pointer-events: none;
    transition: opacity 0.5s;
}
.ornament-tl { top: 1rem; left: 1.5rem; }
.ornament-tr { top: 1rem; right: 1.5rem; transform: scaleX(-1); }
.ornament-bl { bottom: 1rem; left: 1.5rem; transform: scaleY(-1); }
.ornament-br { bottom: 1rem; right: 1.5rem; transform: scale(-1); }

/* --- The Cartouche (Hero) — compact banner --- */
.cartouche {
    padding: 2.5rem 2rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(212,168,67,0.12) 0%, transparent 60%),
        linear-gradient(180deg, var(--parchment) 0%, var(--parchment-dark) 100%);
    border-bottom: 1px solid rgba(184,134,11,0.15);
}

.cartouche-inner {
    position: relative;
    z-index: 1;
}

.cartouche-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(0.7rem, 1.5vw, 0.85rem);
    font-weight: 300;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--ink-light);
    margin-bottom: 0.4rem;
}

.cartouche-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.2rem, 7vw, 4.5rem);
    font-weight: 900;
    color: var(--wine-deep);
    letter-spacing: 0.05em;
    line-height: 1;
    margin-bottom: 0.6rem;

    background: linear-gradient(
        135deg,
        var(--wine-deep) 0%,
        var(--wine) 30%,
        var(--gold) 50%,
        var(--wine) 70%,
        var(--wine-deep) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 8s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 200% center; }
}

.cartouche-motto {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(0.85rem, 2vw, 1.1rem);
    color: var(--ink-light);
    max-width: 500px;
    margin: 0 auto;
    font-weight: 300;
}

.vine-divider {
    width: 100%;
    height: auto;
}

/* --- Weather Strip (thin horizontal bar) --- */
.weather-strip {
    background: var(--wine-deep);
    color: var(--parchment);
    padding: 0.6rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.weather-strip-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.weather-strip-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.weather-strip .weather-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.weather-strip .weather-temp {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold-light);
    line-height: 1;
}

.weather-strip .weather-desc {
    font-style: italic;
    color: var(--parchment-dark);
    font-size: 0.85rem;
    opacity: 0.85;
}

.weather-strip-details {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.weather-strip-detail {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    white-space: nowrap;
}

.weather-strip-detail .detail-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--parchment-dark);
    opacity: 0.6;
}

.weather-strip-detail .detail-value {
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--parchment);
}

.weather-strip-forecast {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    flex-wrap: wrap;
}

.weather-strip-forecast .forecast-day {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-direction: row;
    min-width: auto;
}

.weather-strip-forecast .forecast-name {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--parchment-dark);
    opacity: 0.6;
}

.weather-strip-forecast .forecast-icon {
    font-size: 1rem;
}

.weather-strip-forecast .forecast-temps {
    font-family: 'Playfair Display', serif;
    font-size: 0.75rem;
    color: var(--parchment);
}

.weather-strip-forecast .forecast-rain {
    font-size: 0.65rem;
    color: var(--sky);
    font-style: italic;
}

/* --- Section Titles --- */
.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    color: var(--wine);
    margin-bottom: 1.5rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
    margin-top: 0.5rem;
}

/* --- Two-Column Layout --- */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
}

.content-main {
    min-width: 0;
}

.content-sidebar {
    position: relative;
    border-left: 1px solid rgba(184,134,11,0.15);
    background:
        linear-gradient(135deg, rgba(74,26,32,0.03) 0%, transparent 50%),
        rgba(245,230,200,0.3);
}

.sidebar-inner {
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(184,134,11,0.2) transparent;
}

.sidebar-inner::-webkit-scrollbar {
    width: 4px;
}

.sidebar-inner::-webkit-scrollbar-thumb {
    background: rgba(184,134,11,0.2);
    border-radius: 2px;
}

/* --- Sidebar (Vineyard Work) --- */
.sidebar-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--wine);
    margin-bottom: 0.3rem;
}

.sidebar-journal .journal-date {
    margin-bottom: 1.2rem;
}

.sidebar-journal .journal-entries {
    gap: 1.2rem;
}

.sidebar-journal .journal-entry {
    grid-template-columns: 20px 1fr;
    gap: 0.6rem;
    padding-bottom: 1.2rem;
}

.sidebar-journal .entry-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.sidebar-journal .entry-content p {
    font-size: 0.9rem;
    text-align: left;
    line-height: 1.6;
}

/* --- Manuscript Section (Introduction) --- */
.manuscript {
    display: grid;
    grid-template-columns: 80px 1fr 150px;
    gap: 1rem;
    max-width: 960px;
    margin: 0 auto;
    padding: 6rem 2rem;
    position: relative;
}

.manuscript::before {
    content: '';
    position: absolute;
    left: 80px;
    top: 4rem;
    bottom: 4rem;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--terracotta), transparent);
    opacity: 0.3;
}

.manuscript-margin {
    display: flex;
    justify-content: center;
    padding-top: 4rem;
}

.dropcap {
    font-family: 'UnifrakturMaguntia', cursive;
    font-size: 5rem;
    line-height: 1;
    color: var(--terracotta);
    opacity: 0.6;
    display: block;
}

.manuscript-body {
    padding-top: 0.5rem;
}

.manuscript-body p {
    margin-bottom: 1.2rem;
    text-align: justify;
    hyphens: auto;
    font-size: 1.1rem;
}

.manuscript-body p::first-letter {
    font-size: 1em;
}

.manuscript-illustration {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 3rem;
}

.grape-sketch {
    width: 120px;
    height: auto;
    opacity: 0.5;
}

.grape-sketch .grape {
    fill: none;
    stroke: var(--wine);
    stroke-width: 1.2;
}

.grape-sketch .grape-stem {
    stroke: var(--olive-dark);
}

.grape-sketch .grape-leaf {
    fill: var(--olive);
    opacity: 0.4;
}

/* --- Weather Poem (Dynamic poetic note) --- */
.weather-poem {
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
}

.weather-poem-frame {
    max-width: 700px;
    margin: 0 auto;
    padding: 2.5rem 3rem;
    position: relative;
    border-left: 3px solid var(--gold);
    border-right: 3px solid var(--gold);
    background: linear-gradient(
        135deg,
        rgba(184,134,11,0.03) 0%,
        transparent 50%,
        rgba(184,134,11,0.03) 100%
    );
}

.weather-poem-frame::before,
.weather-poem-frame::after {
    content: '\2767';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: var(--gold);
    opacity: 0.4;
    font-size: 1.2rem;
}

.weather-poem-frame::before { top: -0.7rem; }
.weather-poem-frame::after { bottom: -0.7rem; }

.weather-poem-icon {
    font-size: 2rem;
    color: var(--olive);
    opacity: 0.4;
    margin-bottom: 0.5rem;
}

.weather-poem-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 700;
    color: var(--wine);
    margin-bottom: 1rem;
    font-style: italic;
}

.weather-poem-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    font-style: italic;
    color: var(--ink-light);
    line-height: 1.9;
    max-width: 600px;
    margin: 0 auto 1rem;
}

.weather-poem-date {
    font-size: 0.75rem;
    color: var(--ink-light);
    opacity: 0.4;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.journal-loading {
    text-align: center;
    padding: 2rem;
    color: var(--ink-light);
    opacity: 0.6;
}

/* (Weather styles are in .weather-strip above) */

/* --- Journal Shared Styles --- */
.journal-date {
    font-style: italic;
    color: var(--terracotta);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.journal-entries {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.journal-entry {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 0.8rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(184,134,11,0.1);
}

.journal-entry:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.entry-marker {
    color: var(--gold);
    font-size: 0.9rem;
    padding-top: 0.15rem;
    text-align: center;
}

.entry-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--wine);
    margin-bottom: 0.3rem;
}

.entry-content p {
    font-size: 0.92rem;
    text-align: left;
    hyphens: auto;
    color: var(--ink-light);
    line-height: 1.65;
}

/* --- Colophon (Footer) --- */
.colophon {
    padding: 4rem 2rem;
    text-align: center;
    background: linear-gradient(180deg, var(--parchment), var(--parchment-dark));
}

.colophon-inner {
    max-width: 400px;
    margin: 0 auto;
}

.colophon .vine-divider {
    width: 150px;
    margin: 0 auto 1.5rem;
    display: block;
    color: var(--gold);
    opacity: 0.4;
}

.colophon p {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--ink-light);
    letter-spacing: 0.05em;
}

.colophon-small {
    font-family: 'Cormorant Garamond', serif !important;
    font-size: 0.85rem !important;
    margin-top: 0.3rem;
    opacity: 0.6;
    letter-spacing: 0.15em !important;
    text-transform: uppercase;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .content-layout {
        grid-template-columns: 1fr 340px;
    }
}

@media (max-width: 768px) {
    .content-layout {
        grid-template-columns: 1fr;
    }

    .content-sidebar {
        border-left: none;
        border-top: 1px solid rgba(184,134,11,0.15);
    }

    .sidebar-inner {
        position: static;
        max-height: none;
        overflow-y: visible;
    }

    .manuscript {
        grid-template-columns: 1fr;
        padding: 3rem 1.5rem;
    }

    .manuscript::before {
        display: none;
    }

    .manuscript-margin {
        padding-top: 0;
        justify-content: flex-start;
    }

    .dropcap {
        font-size: 3.5rem;
    }

    .manuscript-illustration {
        display: none;
    }

    .ornament {
        display: none;
    }

    .weather-strip-details {
        gap: 0.8rem;
    }

    .weather-strip-forecast {
        margin-left: 0;
        width: 100%;
    }

    .weather-strip-inner {
        gap: 0.8rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 16px;
    }

    .cartouche-title {
        letter-spacing: 0;
    }

    .forecast-row {
        gap: 0.8rem;
    }

    .forecast-day {
        min-width: 55px;
    }
}

/* === Subtle entrance animations === */
@media (prefers-reduced-motion: no-preference) {
    .manuscript,
    .weather-poem,
    .content-sidebar {
        animation: fadeUp 1s ease-out both;
    }

    .weather-poem { animation-delay: 0.1s; }
    .content-sidebar { animation-delay: 0.2s; }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
