/* 1. CSS Variables / Design Tokens */
:root {
    --color-background: #F4E5D3;
    --color-surface: #FFF8E7;
    --color-text: #2B1107;
    --color-accent: #C85A32;
    --color-wine: #5C1D24;
    --color-brand: #3b2314;
    --color-card-border: rgba(43, 17, 7, 0.12);
    --font-heading: 'Cormorant Garamond', 'Nirvana Serif Fallback', serif;
    --font-body: 'Montserrat', 'Nirvana Content Sans Fallback', sans-serif;
    --font-script: 'Dancing Script', 'Nirvana Script Fallback', 'Apple Chancery', cursive;
    --font-size-sm: 0.85rem;
    --font-size-lg: 1.5rem;
    --font-size-xl: 1.6rem;
    --font-size-2xl: 1.8rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    --space-xs: 8px;
    --space-sm: 15px;
    --space-md: 20px;
    --space-lg: 25px;
    --space-xl: 30px;
    --space-2xl: 40px;
    --space-3xl: 50px;
    --space-4xl: 60px;
    --radius-card: 16px;
    --shadow-card: 0 10px 30px rgba(43, 17, 7, 0.08);
    --shadow-card-hover: 0 18px 40px rgba(43, 17, 7, 0.15);
    --transition-fast: 0.2s;
    --transition-normal: 0.3s;
    --transition-reveal: 0.8s;
    --container-max-width: 1240px;
    --header-height: 140px;
}

/* 2. Reset & Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 12px);
}

body {
    margin: 0;
    background-color: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.6;
}

/* Keep the visitor's viewport when late fonts replace the fallback geometry.
   Navigation owns intentional positioning; automatic scroll events are not input. */
.has-js body {
    overflow-anchor: none;
}

section {
    max-width: 100%;
}

/* 3. Typography */
.hero-section h1,
.about-intro,
.about-card h3,
.about-warmth-banner h3,
.welcome-tag,
.footer-info h2 {
    font-family: var(--font-heading);
}

/* 4. Layout & Containers */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* 5. Header & Navigation */
.site-header {
    font-family: 'Montserrat', 'Nirvana Sans Fallback', sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid rgba(54, 22, 10, 0.15);
}

.top-bar {
    border-bottom: 1px solid rgba(54, 22, 10, 0.1);
    padding: var(--space-xs) 0;
    font-size: var(--font-size-sm);
}

.top-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.contacts-header {
    min-width: 0;
    overflow-wrap: anywhere;
}

.contacts-header a,
.contacts-header span {
    color: var(--color-text);
    text-decoration: none;
    margin-right: var(--space-sm);
}

.social-header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.social-header a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(59, 35, 20, 0.1);
    color: var(--color-brand);
    font-size: var(--font-size-sm);
    text-decoration: none;
    transition: all var(--transition-fast) ease;
}

.social-header a:hover {
    background: var(--color-brand);
    color: #fff;
}

.main-header {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas: 'logo tools slogan navigation';
    align-items: center;
    gap: 20px;
    padding: var(--space-sm) var(--space-md);
}

.logo-link {
    grid-area: logo;
    min-width: 0;
    max-width: 190px;
}

.logo-link img {
    max-height: 55px;
    width: auto;
    object-fit: contain;
    display: block;
    max-width: 100%;
}

.header-tools {
    grid-area: tools;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.header-call {
    display: none;
    color: var(--color-wine);
    border: 1px solid var(--color-card-border);
    border-radius: 8px;
    background: var(--color-surface);
}

.header-call svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-slogan {
    grid-area: slogan;
    min-width: 0;
    font-family: var(--font-script);
    font-size: clamp(1.4rem, 2.6vw, 2.2rem);
    font-weight: 700;
    color: var(--color-brand);
    text-align: center;
    line-height: 1.15;
    display: inline-block;
}

.nav-menu {
    font-family: 'Montserrat', 'Nirvana Navigation Fallback', sans-serif;
    grid-area: navigation;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 16px;
    min-width: 0;
}

.nav-menu a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 4px;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
}

.nav-menu a[aria-current="page"] {
    color: var(--color-wine);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
}

/* 6. Language Switcher */
.lang-switcher {
    display: flex;
    gap: 5px;
}

.lang-btn {
    font-family: 'Montserrat', 'Nirvana UI Fallback', sans-serif;
    background: transparent;
    border: 1px solid var(--color-text);
    color: var(--color-text);
    padding: 2px var(--space-xs);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.75rem;
    transition: all var(--transition-normal);
}

.lang-btn.active,
.lang-btn:hover {
    background-color: var(--color-text);
    color: var(--color-background);
}

.lang-switcher a.lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: normal;
    text-decoration: none;
}

/* 7. Hero Section */
.hero-section {
    padding: 100px var(--space-md) 80px;
    text-align: center;
    color: var(--color-background);
    position: relative;
}

.hero-background {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(rgba(43, 17, 7, 0.7), rgba(43, 17, 7, 0.7));
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    max-width: 11.925em;
    font-size: 3rem;
    margin: 0 auto var(--space-md);
    line-height: 1.25;
    color: var(--color-surface);
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.hero-section p {
    max-width: 39.72em;
    font-size: 1.2rem;
    margin: 0 auto var(--space-xl);
    opacity: 0.95;
    color: var(--color-surface);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.hero-menu-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    max-width: 100%;
    padding: 12px 24px;
    border: 1px solid var(--color-surface);
    border-radius: 8px;
    background: var(--color-surface);
    box-shadow: 0 4px 16px rgb(0 0 0 / 12%);
    color: var(--color-wine);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.hero-menu-link:hover {
    background: var(--color-wine);
    color: var(--color-surface);
}

.hero-menu-link:focus-visible {
    outline-color: var(--color-surface);
}

/* 8. About Section */
.about-section {
    padding: var(--space-2xl) var(--space-md) 70px;
}

.about-intro,
.about-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    text-align: center;
}

.about-intro {
    max-width: 850px;
    margin: 0 auto var(--space-3xl);
    font-size: var(--font-size-2xl);
    font-style: italic;
    line-height: 1.5;
    color: var(--color-text);
    padding: var(--space-2xl) var(--space-xl);
    position: relative;
    overflow: hidden;
}

.about-intro::before,
.about-intro::after {
    position: absolute;
    font-size: 8rem;
    color: rgba(43, 17, 7, 0.05);
    line-height: 1;
}

.about-intro::before {
    content: '\201c';
    top: 10px;
    left: var(--space-md);
}

.about-intro::after {
    content: '\201d';
    bottom: -30px;
    right: var(--space-md);
}

.about-intro p {
    position: relative;
    z-index: 1;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-3xl);
}

.about-grid > .about-card {
    grid-column: span 2;
}

.about-grid > .about-card:nth-last-child(-n + 2) {
    grid-column: span 3;
}

.about-card {
    min-width: 0;
    overflow-wrap: break-word;
    padding: var(--space-xl) var(--space-lg);
    transition: all var(--transition-normal) ease-in-out;
}

.about-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
}

.card-icon {
    font-size: var(--font-size-4xl);
    color: var(--color-accent);
    margin-bottom: var(--space-sm);
}

.about-card h3 {
    font-size: var(--font-size-xl);
    margin-bottom: 12px;
}

.about-warmth-banner {
    overflow-wrap: break-word;
    background-color: var(--color-wine);
    color: var(--color-background);
    padding: var(--space-3xl) var(--space-2xl);
    border-radius: 20px;
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.about-warmth-banner::before {
    content: '';
    background:
        radial-gradient(ellipse at 20% 15%, rgb(212 175 112 / 45%), transparent 65%),
        radial-gradient(ellipse at 85% 80%, rgb(244 229 211 / 20%), transparent 60%);
    opacity: 0.1;
    position: absolute;
    inset: 0;
    z-index: 0;
}

.about-warmth-banner h3,
.about-warmth-banner p,
.welcome-tag {
    position: relative;
    z-index: 1;
}

.about-warmth-banner h3 {
    font-size: 2.6rem;
    margin-bottom: var(--space-md);
    color: var(--color-background);
}

.about-warmth-banner p {
    font-size: 1.15rem;
    margin-bottom: var(--space-lg);
    opacity: 0.95;
    line-height: 1.7;
}

.welcome-tag {
    font-size: var(--font-size-3xl);
    font-weight: bold;
    color: var(--color-surface);
    letter-spacing: 1px;
}

/* 9. Footer & Contacts */
.site-footer {
    background-color: var(--color-text);
    color: var(--color-surface);
    padding-top: var(--space-4xl);
    position: relative;
}

.footer-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: var(--space-2xl);
    align-items: center;
    width: 100%;
}

.footer-info,
.footer-map {
    width: 100%;
    min-width: 0;
}

.footer-map iframe {
    width: 100%;
    max-width: 100%;
    height: 320px;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: block;
}

.footer-map > iframe[hidden] {
    display: none;
}

.has-js .footer-map > iframe[hidden] {
    display: block;
    visibility: hidden;
}

.footer-info h2 {
    font-size: var(--font-size-4xl);
    margin-top: 1em;
    margin-bottom: var(--space-md);
    color: var(--color-surface);
}

.footer-info p {
    overflow-wrap: anywhere;
    margin-bottom: 12px;
    font-size: 1.05rem;
    line-height: 1.7;
}

.footer-info p i {
    color: var(--color-accent);
    margin-right: 10px;
}

.footer-phone {
    color: inherit;
    text-decoration: none;
}

.footer-hours {
    width: fit-content;
    max-width: min(100%, 300px);
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgb(255 248 231 / 16%);
}

.footer-hours-heading {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
}

.footer-hours-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-hours-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 24px;
    min-width: 0;
    color: rgb(255 248 231 / 85%);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.footer-hours-time {
    color: var(--color-surface);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.footer-hours-closed {
    color: #D9BF95;
    text-align: right;
    white-space: nowrap;
}

.footer-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: var(--space-lg);
}

.footer-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    color: var(--color-surface);
    font-size: var(--font-size-lg);
    text-decoration: none;
    transition: color var(--transition-normal) ease;
}

.footer-socials a:hover {
    color: var(--color-accent);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 248, 231, 0.15);
    text-align: center;
    padding: var(--space-md);
    font-size: 0.9rem;
    color: rgba(255, 248, 231, 0.7);
}

/* 10. Shared Components */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 40px);
    margin: clamp(32px, 6vw, 60px) auto;
    max-width: 800px;
    position: relative;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background-color: rgba(43, 17, 7, 0.2);
}

.section-divider i {
    font-size: var(--font-size-2xl);
    color: var(--color-accent);
    margin: 0 var(--space-md);
    display: block;
}

/* 11. Accessibility */
.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    padding: 10px 18px;
    border-radius: 6px;
    background: var(--color-wine);
    color: var(--color-surface);
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

a:focus-visible,
button:focus-visible,
iframe:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
}

/* 12. Responsive Styles & Scroll Animations */
@media (max-width: 1000px) {
    .about-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .about-grid > .about-card,
    .about-grid > .about-card:nth-last-child(-n + 2) {
        grid-column: auto;
    }

    .about-grid > .about-card:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .about-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 900px) {
    :root {
        --header-height: 132px;
    }

    .top-bar {
        display: none;
    }

    .main-header {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: 'logo tools' 'slogan slogan' 'navigation navigation';
        gap: 2px 8px;
        padding: 6px 12px;
    }

    .header-tools {
        justify-content: flex-end;
    }

    .lang-switcher {
        gap: 4px;
    }

    .lang-btn {
        min-width: 34px;
        min-height: 44px;
        padding: 4px 6px;
    }

    .header-call {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        flex: 0 0 auto;
    }

    .header-slogan {
        margin: 0;
        padding: 0 4px;
        font-size: clamp(1.35rem, 6vw, 1.75rem);
    }

    .logo-link img {
        width: clamp(96px, 32vw, 144px);
        height: auto;
        max-height: 40px;
    }

    .nav-menu {
        gap: 4px;
    }

    .nav-menu a {
        flex: 1 1 0;
        min-width: 0;
        padding: 8px 4px;
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: clamp(32px, 7vw, 48px) 16px;
        background-position: center;
    }

    .hero-section h1 {
        font-size: clamp(2rem, 7.7vw, 2.6rem);
        line-height: 1.15;
        margin-bottom: 16px;
    }

    .hero-section p {
        max-width: 25.156em;
        font-size: clamp(0.95rem, 2.5vw, 1.1rem);
        line-height: 1.65;
        margin-bottom: 20px;
    }

    .about-section {
        padding: 24px 16px 40px;
    }

    .about-intro {
        font-size: clamp(1.25rem, 4vw, 1.5rem);
        padding: 24px 20px;
        margin-bottom: 24px;
    }

    .about-grid {
        gap: 20px;
        margin-bottom: 24px;
    }

    .about-card {
        padding: 24px 20px;
    }

    .about-intro::before,
    .about-intro::after {
        font-size: 5rem;
    }

    .about-warmth-banner h3,
    .footer-info h2 {
        font-size: var(--font-size-3xl);
    }

    .about-warmth-banner {
        padding: 32px 24px;
    }

    .about-warmth-banner h3 {
        margin-top: 0;
        font-size: clamp(1.7rem, 6vw, 2rem);
    }

    .about-warmth-banner p {
        font-size: 1rem;
    }

    .welcome-tag {
        font-size: 1.4rem;
    }

    .site-footer {
        padding-top: 32px;
    }

    .footer-content {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .footer-info h2 {
        margin-top: 0;
    }

    .footer-map iframe {
        height: 250px;
    }

    .has-scroll-reveal .fade-in-section {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity var(--transition-reveal) ease-out, transform var(--transition-reveal) ease-out;
        will-change: opacity, transform;
    }

    .has-scroll-reveal .fade-in-section.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

    /* These sections already remain opaque throughout the mobile reveal. */
    .about-section.fade-in-section,
    .site-footer.fade-in-section {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .fade-in-section,
    .has-scroll-reveal .fade-in-section,
    .has-scroll-reveal .fade-in-section.is-visible {
        opacity: 1;
        transform: none;
        transition: none;
        will-change: auto;
    }

    .about-card,
    .lang-btn,
    .social-header a,
    .footer-socials a,
    .hero-menu-link {
        transition: none;
    }

    .about-card:hover {
        transform: none;
    }
}

/* Bulgarian locl recovery widths; the brand face remains first. */
:root:lang(bg) { --font-heading: 'Cormorant Garamond', 'Nirvana Serif BG Fallback', serif; }

:root:lang(uk) { --font-heading: 'Cormorant Garamond', 'Nirvana Serif UK Fallback', serif; }

/* Text-specific recovery metrics from the existing localized hero and quote. */
:root:lang(bg) .hero-section p { font-family: 'Montserrat', 'Nirvana Hero BG Fallback', sans-serif; }
:root:lang(bg) .about-intro { font-family: 'Cormorant Garamond', 'Nirvana Quote BG Fallback', serif; }
:root:lang(uk) .about-intro { font-family: 'Cormorant Garamond', 'Nirvana Quote UK Fallback', serif; }
