/* ════════════════════════════════════════════════════════════════
   TrabocchiVacanze — Global Design System
   Branch: new-template
   Palette: deep teal #0a3d52 · gold #c9a96e · cream #faf6f0 · dark #1a2d35
   Fonts: Cormorant Garamond (serif) · DM Sans (sans)
   ════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────────────── */
:root {
    --color-deep:    #0a3d52;
    --color-teal:    #0f5e7e;
    --color-gold:    #c9a96e;
    --color-gold-dk: #b8965c;
    --color-cream:   #faf6f0;
    --color-white:   #ffffff;
    --color-dark:    #1a2d35;
    --color-muted:   #5c7078;
    --color-border:  rgba(10,61,82,.12);

    --font-serif:    'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --font-sans:     'DM Sans', system-ui, -apple-system, sans-serif;

    --nav-h:         72px;
    --radius-sm:     4px;
    --radius-md:     8px;

    --shadow-sm:  0 2px 8px rgba(10,30,39,.08);
    --shadow-md:  0 8px 32px rgba(10,30,39,.12);
    --shadow-lg:  0 24px 64px rgba(10,30,39,.18);
}

/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-dark);
    background: var(--color-cream);
}

img, video { max-width: 100%; height: auto; display: block; }

/* ── Typography ────────────────────────────────────────────────── */
h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.15;
    color: var(--color-dark);
    margin: 0 0 1rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 3rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1.25rem; }

a {
    color: var(--color-deep);
    text-decoration: none;
    transition: color .2s;
}
a:hover { color: var(--color-gold); }

/* ── Layout helpers ────────────────────────────────────────────── */
.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-body {
    flex: 1;
    /* Push content below fixed nav — only on non-hero pages */
}

/* Pages without a full-bleed hero need top padding to clear the fixed nav */
.inner-page {
    padding-top: var(--nav-h);
}

.container {
    width: min(1200px, calc(100% - 3rem));
    margin: 0 auto;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .7rem 1.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: .88rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform .2s, background .2s, box-shadow .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus { outline: 2px solid var(--color-gold); outline-offset: 3px; }

.btn-primary {
    background: var(--color-gold);
    color: var(--color-dark) !important;
    box-shadow: 0 6px 20px rgba(201,169,110,.35);
}
.btn-primary:hover { background: var(--color-gold-dk); box-shadow: 0 10px 28px rgba(201,169,110,.45); }

.btn-secondary {
    background: transparent;
    color: var(--color-deep) !important;
    border: 1.5px solid var(--color-deep);
}
.btn-secondary:hover { background: var(--color-deep); color: white !important; }

.btn-outline-gold {
    background: transparent;
    color: var(--color-gold) !important;
    border: 1.5px solid var(--color-gold);
}
.btn-outline-gold:hover { background: var(--color-gold); color: var(--color-dark) !important; }

/* ── Form elements ─────────────────────────────────────────────── */
.form-control,
input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="password"],
select,
textarea {
    font-family: var(--font-sans);
    font-size: .9rem;
    padding: .65rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--color-dark);
    width: 100%;
    transition: border-color .2s, box-shadow .2s;
    appearance: none;
}
.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-teal);
    box-shadow: 0 0 0 3px rgba(15,94,126,.12);
}

.form-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--color-muted);
    text-transform: uppercase;
    margin-bottom: .4rem;
}

/* Validation states */
.valid.modified:not([type=checkbox]) { border-color: #2ea043; }
.invalid { border-color: #cf222e; }
.validation-message { color: #cf222e; font-size: .82rem; margin-top: .25rem; }

/* ── Section patterns ──────────────────────────────────────────── */
.section {
    padding: 6rem 0;
}
.section-label {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: .72rem;
    font-weight: 600;
    color: var(--color-gold);
    margin-bottom: .9rem;
}
.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-header p {
    color: var(--color-muted);
    font-size: 1.05rem;
    margin: 0;
    max-width: 560px;
    margin: 0 auto;
}

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}
.card-body { padding: 1.75rem; }
.card-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 .6rem;
    color: var(--color-dark);
}
.card-text { font-size: .88rem; color: var(--color-muted); line-height: 1.7; margin: 0; }

/* ── Blazor error boundary ─────────────────────────────────────── */
.blazor-error-boundary {
    background: #b32121 url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbmsiPjxwYXRoIGZpbGw9IiNGRkU1MDAiIGQ9Ik0yNy41IDNMMiA0N2g1MUwyNy41IDN6Ii8+PC9zdmc+") no-repeat 1rem/1.8rem;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: var(--radius-sm);
    margin: 1rem;
}
.blazor-error-boundary::after { content: "Si è verificato un errore."; }

/* ── Reconnect modal ───────────────────────────────────────────── */
#blazor-error-ui {
    background: var(--color-gold);
    bottom: 0; left: 0; right: 0;
    position: fixed;
    z-index: 9999;
    padding: .85rem 1.5rem;
    display: none;
    font-family: var(--font-sans);
    font-size: .88rem;
    color: var(--color-dark);
    font-weight: 500;
    text-align: center;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    margin-left: 1rem;
    opacity: .7;
}
#blazor-error-ui .dismiss:hover { opacity: 1; }

/* ── Bootstrap overrides ───────────────────────────────────────── */
/* We're not using Bootstrap layout, just keep form + utility classes working */
.btn-link {
    color: var(--color-teal);
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
}
.btn-link:hover { color: var(--color-gold); text-decoration: underline; }

/* Focus visible (accessibility) */
:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 3px;
}

/* ── Utility classes ───────────────────────────────────────────── */
.text-muted      { color: var(--color-muted) !important; }
.text-gold       { color: var(--color-gold) !important; }
.text-deep       { color: var(--color-deep) !important; }
.text-center     { text-align: center; }
.serif           { font-family: var(--font-serif); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-cream); }
::-webkit-scrollbar-thumb { background: rgba(10,61,82,.25); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(10,61,82,.45); }

/* ── Contact bar (shared component) ───────────────────────────── */
.contact-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 1.5rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(255,255,255,.12);
}
.contact-bar a {
    color: rgba(255,255,255,.65);
    font-size: .9rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .4rem;
    transition: color .2s;
}
.contact-bar a:hover { color: var(--color-gold); }

/* ── Admin pages — keep working ────────────────────────────────── */
.admin-layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--nav-h);
}

/* ── Responsive breakpoints ────────────────────────────────────── */
@media (max-width: 860px) {
    h1:focus { outline: none; }
}

/* ── Skin Canvas (yacht): logo testuale nell'header ────────────── */
.tv-logo-text {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0D2B4E;
    letter-spacing: .03em;
    text-decoration: none;
    transition: color .3s;
}
.tv-logo-text em { font-style: normal; font-weight: 400; }
.tv-logo-text:hover { color: #A07828; }
.tv-logo-icon { font-size: 1.3rem; }

/* Bottone oro pieno (variante del charter-cta-gold della demo, non legato a #charter-types) */
.tv-btn-gold {
    display: inline-block;
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #0D2B4E !important;
    background: #C9A84C;
    border: 1px solid #C9A84C;
    padding: 15px 34px;
    transition: background 0.25s, border-color 0.25s, color 0.25s;
    text-decoration: none;
}
.tv-btn-gold:hover {
    background: #A07828;
    border-color: #A07828;
    color: #fff !important;
}
