@import url('https://fonts.googleapis.com/css2?family=Bodoni+Moda:opsz,wght@6..96,400;6..96,500;6..96,600;6..96,700&family=Cinzel:wght@400;500;600;700&family=Cormorant+Garamond:wght@400;500;600;700&family=Dancing+Script:wght@400;500;600;700&family=EB+Garamond:wght@400;500;600;700&family=Forum&family=Great+Vibes&family=Josefin+Sans:wght@300;400;500;600;700&family=Libre+Baskerville:wght@400;700&family=Lora:wght@400;500;600;700&family=Marcellus&family=Merriweather:wght@300;400;700&family=Montserrat:wght@300;400;500;600;700&family=Parisienne&family=Petit+Formal+Script&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=Poppins:wght@300;400;500;600;700&family=Raleway:wght@300;400;500;600;700&family=Sacramento&family=Tangerine:wght@400;700&display=swap');

:root {
    color-scheme: light;

    --color-wine-950: #2b040b;
    --color-wine-900: #3b0610;
    --color-wine-800: #540917;
    --color-wine-700: #7f1024;
    --color-wine-600: #9d1730;
    --color-gold-800: #7b4d16;
    --color-gold-700: #9f6b22;
    --color-gold-600: #c4872f;
    --color-gold-500: #d49a3a;
    --color-gold-300: #ecd2a0;
    --color-paper-50: #fffaf1;
    --color-paper-100: #fff8ed;
    --color-paper-200: #fff3dd;
    --color-paper-300: #f7ead7;
    --color-blush-100: #fae7df;
    --color-ink-900: #302829;
    --color-ink-700: #5f5351;
    --color-ink-600: #766865;
    --color-green-700: #315c35;
    --color-green-100: #e9f5e8;
    --color-red-100: #fff0f0;

    --rgb-wine: 127 16 36;
    --rgb-wine-dark: 84 9 23;
    --rgb-gold: 212 154 58;
    --rgb-gold-dark: 159 107 34;
    --rgb-paper: 255 248 237;
    --rgb-cream: 255 243 221;
    --rgb-card: 255 250 241;
    --rgb-ink: 48 40 41;

    --surface-page: var(--color-paper-100);
    --surface-cream: var(--color-paper-200);
    --surface-soft: var(--color-paper-50);
    --surface-deep: var(--color-paper-300);
    --surface-card: rgb(var(--rgb-card) / .78);
    --surface-card-strong: rgb(var(--rgb-card) / .94);

    --text-main: var(--color-ink-900);
    --text-muted: var(--color-ink-600);
    --brand-primary: var(--color-wine-700);
    --brand-primary-dark: var(--color-wine-800);
    --brand-accent: var(--color-gold-500);
    --brand-accent-dark: var(--color-gold-700);
    --border-soft: rgb(178 129 60 / .3);
    --border-brand: rgb(var(--rgb-wine) / .22);

    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --radius-xs: .22rem;
    --radius-sm: .45rem;
    --radius-md: .8rem;
    --radius-lg: 1.25rem;
    --radius-xl: 1.8rem;
    --radius-pill: 999px;

    --shadow-xs: 0 8px 22px rgb(var(--rgb-wine-dark) / .08);
    --shadow-sm: 0 16px 42px rgb(var(--rgb-wine-dark) / .12);
    --shadow-md: 0 24px 70px rgb(var(--rgb-wine-dark) / .16);
    --shadow-glow: 0 20px 80px rgb(var(--rgb-gold) / .18);

    --edge: clamp(1.25rem, 5vw, 4.3rem);
    --max: 1640px;

    /* Compatibility aliases used by existing page CSS and JS-generated UI. */
    --paper: var(--surface-page);
    --paper-deep: var(--surface-deep);
    --cream: var(--surface-cream);
    --cream-soft: var(--surface-soft);
    --blush: var(--color-blush-100);
    --wine: var(--brand-primary);
    --wine-dark: var(--brand-primary-dark);
    --rose: #c76e66;
    --gold: var(--brand-accent);
    --gold-soft: var(--color-gold-300);
    --gold-dark: var(--brand-accent-dark);
    --ink: var(--text-main);
    --muted: var(--text-muted);
    --line: var(--border-soft);
    --line-strong: var(--border-brand);
    --display-font: var(--font-display);
    --body-font: var(--font-body);
    --shadow-soft: var(--shadow-sm);
    --shadow-card: var(--shadow-sm);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; font-family: var(--font-body); background: var(--surface-page); color: var(--text-main); }
body { overflow-x: hidden; }
img, svg, canvas { max-width: 100%; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { background: rgb(var(--rgb-wine) / .16); }
:focus-visible { outline: 3px solid rgb(var(--rgb-gold) / .9); outline-offset: 3px; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: .98;
    color: var(--brand-primary);
}

p { line-height: 1.72; }
a { color: var(--brand-primary); }

.site-main {
    background:
        radial-gradient(circle at 8% 0, rgb(var(--rgb-gold) / .14), transparent 26rem),
        radial-gradient(circle at 95% 12rem, rgb(var(--rgb-wine) / .055), transparent 28rem),
        linear-gradient(180deg, var(--surface-soft), var(--surface-page) 32rem);
}

.section-wrap { width: min(var(--max), calc(100% - (var(--edge) * 2))); margin-inline: auto; }

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0 0 2rem;
    text-align: center;
    font-size: clamp(2rem, 4vw, 3.25rem);
    letter-spacing: .025em;
    text-transform: uppercase;
}
.section-title::before,
.section-title::after { content: ""; width: min(7rem, 16vw); height: 1px; background: linear-gradient(90deg, transparent, var(--brand-accent)); }
.section-title::after { background: linear-gradient(90deg, var(--brand-accent), transparent); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .85rem;
    color: var(--brand-accent-dark);
    font-size: .76rem;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: .22em;
}
.eyebrow::before { content: "✺"; color: var(--brand-accent); font-size: 1.2rem; letter-spacing: 0; }

.mini-rule { display: flex; align-items: center; gap: .65rem; color: var(--brand-accent); margin: .75rem 0; }
.mini-rule::before, .mini-rule::after { content: ""; width: 3.6rem; height: 1px; background: var(--color-gold-300); opacity: .7; }

.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    min-height: 3rem;
    padding: .85rem 1.3rem;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    text-decoration: none;
    text-transform: uppercase;
    font-size: .82rem;
    font-weight: 900;
    letter-spacing: .075em;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
}
.btn-primary { background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark)); color: var(--surface-cream); box-shadow: var(--shadow-sm); }
.btn-primary:hover { color: #fff; transform: translateY(-1px); }
.btn-outline { background: rgb(255 255 255 / .42); color: var(--brand-primary); border-color: rgb(var(--rgb-wine) / .26); }
.btn-outline:hover { background: rgb(var(--rgb-wine) / .075); border-color: rgb(var(--rgb-wine) / .38); }
.btn.full { width: 100%; }

.card {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgb(var(--rgb-card) / .82), rgb(var(--rgb-paper) / .68));
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
}

.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, .94fr) minmax(26rem, 1.18fr);
    min-height: clamp(31rem, 51vw, 43rem);
    overflow: hidden;
    border-bottom: 1px solid var(--border-soft);
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 22% 43%, rgb(255 242 214 / .94), rgb(var(--rgb-paper) / .72) 24%, transparent 55%),
        linear-gradient(90deg, rgb(var(--rgb-card) / .64), transparent 62%);
    pointer-events: none;
    z-index: 1;
}
.hero__content { position: relative; z-index: 2; align-self: center; padding: clamp(3rem, 6vw, 6rem) var(--edge); }
.hero__content h1 { margin: .9rem 0 1.25rem; max-width: 12ch; font-size: clamp(3rem, 7vw, 5.8rem); letter-spacing: .035em; text-transform: uppercase; }
.hero__content p { max-width: 33rem; margin: 0 0 2.1rem; color: var(--text-main); font-size: clamp(1rem, 1.35vw, 1.22rem); }
.hero__image { position: relative; min-height: 100%; background-image: url('/images/generated/hero-vineyard-bottle.jpg'); background-size: cover; background-position: center; }
.hero__image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(var(--rgb-paper) / .96), rgb(var(--rgb-paper) / .22) 35%, transparent 76%); }

.page-hero {
    min-height: clamp(19rem, 29vw, 24rem);
    border-bottom: 1px solid var(--border-soft);
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, rgb(var(--rgb-card) / .97) 0%, rgb(var(--rgb-card) / .91) 36%, rgb(var(--rgb-card) / .24) 68%), var(--hero-image, url('/images/generated/vineyard-banner.jpg')) right center / cover no-repeat;
}
.page-hero::before {
    content: "";
    position: absolute;
    left: 10%;
    top: 14%;
    width: 24rem;
    height: 24rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgb(var(--rgb-gold) / .14), transparent 70%);
    opacity: .65;
}
.page-hero .section-wrap { position: relative; z-index: 1; padding: clamp(2.3rem, 5vw, 4.7rem) 0; }
.breadcrumb { display: flex; align-items: center; gap: .7rem; color: var(--text-muted); font-size: .85rem; margin-bottom: 1.6rem; }
.breadcrumb a { text-decoration: none; color: var(--text-main); }
.page-hero h1 { margin: .7rem 0 1.1rem; font-size: clamp(3.2rem, 7vw, 5.8rem); letter-spacing: .04em; text-transform: uppercase; max-width: 12ch; }
.page-hero p { max-width: 35rem; margin: 0; font-size: clamp(1rem, 1.3vw, 1.17rem); color: var(--text-main); }

.awards-band { border-block: 1px solid var(--border-soft); background: rgb(var(--rgb-card) / .74); }
.awards-layout { display: grid; grid-template-columns: minmax(10rem, .82fr) minmax(0, 2.8fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: center; padding-block: clamp(2.2rem, 4.8vw, 3.4rem); }
.awards-copy h2 { margin: 0 0 1rem; font-size: clamp(2rem, 3vw, 2.8rem); text-transform: uppercase; }
.awards-copy p { margin: 0; max-width: 16rem; font-size: .92rem; color: var(--text-main); }
.medal-row { display: grid; grid-template-columns: repeat(5, minmax(6rem, 1fr)); gap: 1.2rem; align-items: start; }
.medal-item { text-align: center; font-size: .78rem; font-weight: 900; line-height: 1.25; text-transform: uppercase; color: var(--text-main); }
.medal-item img { display: block; width: clamp(4.4rem, 8vw, 6.9rem); margin: 0 auto .75rem; filter: drop-shadow(0 7px 10px rgb(54 34 20 / .13)); }

.form-field { display: grid; gap: .45rem; }
.form-field label { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 900; }
.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: rgb(255 255 255 / .58);
    color: var(--text-main);
    padding: .82rem .92rem;
    outline-color: rgb(var(--rgb-wine) / .35);
}
.form-field textarea { min-height: 8rem; resize: vertical; }
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus { border-color: var(--brand-accent-dark); box-shadow: 0 0 0 3px rgb(var(--rgb-gold) / .14); }
.validation-message { color: var(--color-wine-600); font-size: .8rem; font-weight: 800; }
.input-validation-error { border-color: var(--color-wine-600) !important; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }

#blazor-error-ui { background: var(--color-red-100); bottom: 0; box-shadow: 0 -1px 2px rgb(0 0 0 / .2); display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .35rem; border: 0; background: transparent; color: var(--brand-primary); font-size: 1.15rem; }

/* JS-created custom-label layer rows and guide UI. */
.label-builder .layer-list { display: grid; gap: .62rem; }
.label-builder .layer-item {
    display: grid;
    grid-template-columns: 2.2rem minmax(0, 1fr) 2.2rem 1.6rem;
    align-items: center;
    gap: .65rem;
    min-height: 3.85rem;
    padding: .62rem .72rem;
    border: 1px solid rgb(178 129 60 / .24);
    border-radius: var(--radius-md);
    background: rgb(var(--rgb-card) / .74);
    color: var(--text-main);
    box-shadow: 0 8px 20px rgb(69 37 18 / .035);
    cursor: grab;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.label-builder .layer-item:hover { transform: translateY(-1px); border-color: rgb(var(--rgb-wine) / .2); background: rgb(255 255 255 / .72); }
.label-builder .layer-item.is-active { border-color: rgb(var(--rgb-wine) / .48); background: rgb(255 246 235 / .94); box-shadow: inset 3px 0 0 var(--brand-primary), 0 12px 26px rgb(var(--rgb-wine) / .075); }
.label-builder .layer-item.is-hidden { opacity: .52; }
.label-builder .layer-item.is-dragging { opacity: .58; cursor: grabbing; }
.label-builder .layer-item--locked { cursor: default; opacity: .76; }
.label-builder .layer-item__kind { width: 2.1rem; height: 2.1rem; display: grid; place-items: center; color: rgb(var(--rgb-ink) / .58); font-family: var(--font-display); font-size: 1.78rem; line-height: 1; }
.label-builder .layer-item__kind--image { position: relative; border: 2px solid rgb(var(--rgb-ink) / .42); border-radius: .14rem; width: 1.45rem; height: 1.45rem; justify-self: center; }
.label-builder .layer-item__kind--image::before { content: ""; position: absolute; left: .2rem; right: .2rem; bottom: .22rem; height: .46rem; border-left: .34rem solid transparent; border-right: .34rem solid transparent; border-bottom: .46rem solid rgb(var(--rgb-ink) / .42); }
.label-builder .layer-item__kind--image::after { content: ""; position: absolute; top: .24rem; right: .25rem; width: .22rem; height: .22rem; border-radius: 50%; background: rgb(var(--rgb-ink) / .42); }
.label-builder .layer-item__select { min-width: 0; border: 0; background: transparent; color: rgb(var(--rgb-ink) / .78); text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; font-weight: 700; line-height: 1.25; padding: 0; }
.label-builder .layer-item__select:disabled { cursor: default; }
.label-builder .layer-item__tool { position: relative; width: 2.2rem; height: 2.2rem; border: 0; background: transparent; cursor: pointer; }
.label-builder .layer-item__tool:disabled { cursor: default; }
.label-builder .layer-item__tool--visibility::before { content: ""; position: absolute; left: .38rem; top: .68rem; width: 1.25rem; height: .82rem; border: 2px solid rgb(var(--rgb-wine-dark) / .66); border-radius: 60% 60% 55% 55%; transform: rotate(45deg); }
.label-builder .layer-item__tool--visibility::after { content: ""; position: absolute; left: .88rem; top: .91rem; width: .34rem; height: .34rem; border-radius: 50%; background: rgb(var(--rgb-wine-dark) / .66); }
.label-builder .layer-item.is-hidden .layer-item__tool--visibility::before,
.label-builder .layer-item.is-hidden .layer-item__tool--visibility::after { opacity: .42; }
.label-builder .layer-item__handle { width: 1.3rem; height: 2rem; justify-self: center; background-image: radial-gradient(circle, rgb(var(--rgb-wine-dark) / .62) 1.5px, transparent 1.8px); background-size: .36rem .36rem; background-position: center; }
.label-builder .layer-item__handle--locked { background-image: none; }
.label-builder .layer-item__handle--locked::before { content: ""; display: block; width: .92rem; height: .68rem; margin: .78rem auto 0; border: 2px solid rgb(var(--rgb-wine-dark) / .42); border-radius: .12rem; box-shadow: 0 -.48rem 0 -.26rem rgb(var(--rgb-wine-dark) / .42); }
.label-builder .layer-empty { display: grid; gap: .55rem; padding: 1.15rem; border: 1px dashed rgb(var(--rgb-wine) / .28); border-radius: var(--radius-md); text-align: center; background: rgb(255 255 255 / .35); }
.label-builder .layer-empty strong { color: var(--brand-primary); font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; }
.label-builder .layer-empty span { color: var(--text-muted); font-size: .82rem; }
.label-builder .layer-note { text-align: center; margin: .15rem 0 .35rem; color: rgb(var(--rgb-wine-dark) / .62); font-weight: 700; }
.label-builder .layer-note span { display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; margin-left: .28rem; border: 1px solid rgb(var(--rgb-wine) / .32); border-radius: 50%; color: var(--brand-primary); font-size: .72rem; font-weight: 900; }
.label-builder .layer-actions--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.label-builder .snap-toggle { display: flex; align-items: center; justify-content: center; gap: .55rem; padding: .75rem .8rem; border: 1px solid rgb(178 129 60 / .3); border-radius: var(--radius-md); background: rgb(var(--rgb-card) / .65); color: var(--brand-primary); font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.label-builder .snap-toggle input { accent-color: var(--brand-primary); }
.label-builder .alignment-signal { position: absolute; top: .95rem; left: 50%; z-index: 5; transform: translateX(-50%); max-width: min(90%, 24rem); padding: .42rem .72rem; border-radius: var(--radius-pill); background: rgb(var(--rgb-wine-dark) / .92); color: var(--surface-soft); font-size: .68rem; font-weight: 900; letter-spacing: .055em; text-transform: uppercase; text-align: center; pointer-events: none; box-shadow: 0 8px 18px rgb(44 12 20 / .18); }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (max-width: 930px) {
    .hero { grid-template-columns: 1fr; min-height: auto; }
    .hero__content { min-height: 25rem; padding-block: 3.2rem; }
    .hero__image { min-height: 22rem; order: -1; background-position: center right; }
    .hero__image::after { background: linear-gradient(180deg, rgb(var(--rgb-paper) / .05), rgb(var(--rgb-paper) / .96)); }
    .awards-layout { grid-template-columns: 1fr; }
    .awards-copy { text-align: center; }
    .awards-copy p { margin-inline: auto; }
    .medal-row { grid-template-columns: repeat(5, minmax(5.2rem, 1fr)); overflow-x: auto; padding-bottom: .5rem; }
}

@media (max-width: 650px) {
    :root { --edge: 1.25rem; }
    .section-wrap { width: min(100% - 2rem, var(--max)); }
    .hero__content h1 { font-size: clamp(2.55rem, 12vw, 4.3rem); }
    .page-hero { min-height: 18rem; background-position: 55% center; }
    .page-hero .section-wrap { padding-block: 2.4rem; }
    .page-hero h1 { font-size: clamp(2.85rem, 13vw, 4.2rem); }
    .form-row { grid-template-columns: 1fr; }
    .medal-row { grid-template-columns: repeat(5, 7.2rem); }
}
