@layer base, content, responsive;

@layer base {
    :root {
        color-scheme: light;
        font-family: system-ui, "Segoe UI", sans-serif;
        color: var(--fg-ink);
        background: white;
        line-height: 1.55;
    }

    *, *::before, *::after { box-sizing: border-box; }
    body { margin: 0; }
    h1, h2, h3, p, figure, blockquote { margin: 0; }
    h1, h2, h3 { line-height: 1.13; letter-spacing: -.032em; text-wrap: balance; }
    img { display: block; max-width: 100%; height: auto; }
    a { color: inherit; text-underline-offset: .18em; }
    :is(button, select) { font: inherit; }
    :is(button, summary) { cursor: pointer; }
    :focus-visible { outline: 3px solid #087a9a; outline-offset: 3px; }
    .fg-hero :focus-visible, .fg-reviews :focus-visible { outline-color: #ffc5ad; }
    [hidden] { display: none !important; }
    #transfer-randevu { scroll-margin-top: 100px; }

    .fg-button, .fg-card-link, .fg-call {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: .55rem;
        min-height: 44px;
        font-weight: 700;
        text-decoration: none;
    }
    .fg-button {
        padding: .65rem 1.05rem;
        border-radius: .6rem;
        background: var(--fg-accent);
        color: white;
    }
    .fg-button:hover { background: var(--fg-accent-deep); }
    .fg-button svg, .fg-card-link svg { flex: 0 0 auto; }
    .fg-call { color: var(--fg-navy); text-decoration: underline; }
    .fg-call small { display: block; color: var(--fg-muted); font-size: .78rem; }
    .fg-rich { color: var(--fg-muted); line-height: 1.65; overflow-wrap: anywhere; }
    .fg-rich p + p { margin-block-start: .72em; }
    .fg-rich iframe { width: 100%; max-width: 100%; border: 0; aspect-ratio: 16 / 9; height: auto; }
}

@layer content {
    .fg-hero { position: relative; color: #fff; background: var(--fg-navy); }
    .fg-hero-track, .fg-rail {
        display: grid;
        grid-auto-flow: column;
        margin: 0;
        padding: 0;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-snap-type: x mandatory;
        list-style: none;
    }
    .fg-hero-track { grid-auto-columns: 100%; scrollbar-width: none; }
    .fg-slide {
        position: relative;
        isolation: isolate;
        min-height: clamp(430px, 39vw, 610px);
        display: grid;
        align-items: center;
        scroll-snap-align: start;
    }
    .fg-slide-img, .fg-reviews-bg { position: absolute; inset: 0; z-index: -2; height: 100%; width: 100%; object-fit: cover; }
    .fg-slide-img { object-position: 45% center; }
    .fg-slide::after {
        position: absolute;
        inset: 0;
        z-index: -1;
        content: "";
        background: linear-gradient(90deg, rgb(14 25 36 / .08) 12%, rgb(14 25 36 / .29) 43%, rgb(12 24 33 / .80) 76%, rgb(12 24 33 / .88));
    }
    .fg-slide-position { display: flex; justify-content: flex-end; padding-block: 76px; }
    .fg-slide-copy { width: min(100%, 580px); text-align: end; }
    .fg-slide-copy p {
        margin-block-end: .75rem;
        font-size: clamp(1.05rem, 1.9vw, 1.5rem);
        color: var(--fg-peach);
        font-weight: 750;
    }
    .fg-slide-copy :is(h1, h2), .fg-hero-empty h1 {
        margin-block-end: 1.05rem;
        font-size: clamp(2.6rem, 5vw, 4.8rem);
        color: white;
        font-weight: 800;
        text-shadow: 0 3px 24px rgb(0 0 0 / .3);
    }
    .fg-hero-empty { min-height: 320px; display: grid; align-items: center; }
    .fg-hero .fg-rail-controls { position: absolute; inset: auto var(--fg-gutter) 18px auto; }

    .fg-booking { color: #fff; background: var(--fg-navy); }
    .fg-booking-inner {
        display: grid;
        grid-template-columns: minmax(175px, 260px) minmax(0, 1fr);
        align-items: start;
        gap: clamp(1.25rem, 3vw, 2.55rem);
        padding-block: 1.6rem 1.8rem;
    }
    .fg-booking h2 { font-size: clamp(1.55rem, 2.6vw, 2.1rem); margin-block-start: .22rem; }
    .fg-form {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: end;
        gap: .85rem .7rem;
    }
    .fg-field { min-width: 0; }
    .fg-field label { display: block; font-size: .8rem; font-weight: 650; margin-block-end: .28rem; color: #edf4f4; }
    .fg-field select {
        font-size: .9rem;
        width: 100%;
        min-height: 46px;
        border: 1px solid #cbd7d7;
        border-radius: .48rem;
        padding: .5rem .6rem;
        background-color: #fff;
        color: var(--fg-ink);
    }
    .fg-field select:disabled { color: #435862; background: #e1e8e9; opacity: 1; }
    .fg-book-button { min-height: 46px; justify-content: space-between; }
    .fg-form-status {
        grid-column: 1 / -1;
        color: #f7d7cc;
        min-height: 1.2em;
        line-height: 1.25;
        font-size: .8rem;
        margin-block-start: -.48rem;
    }

    .fg-section { padding-block: clamp(2.5rem, 5vw, 4.4rem); }
    :is(.fg-transfer, .fg-tours):nth-of-type(even), .fg-vehicles { background: var(--fg-surface); }
    .fg-section-title { margin-block-end: clamp(1.1rem, 2.3vw, 1.65rem); }
    .fg-section-title h2 { font-size: clamp(1.78rem, 3.2vw, 2.8rem); font-weight: 780; }
    .fg-section-title h2::after {
        display: block;
        width: 2.55rem;
        height: .2rem;
        border-radius: 100vw;
        margin-block-start: .67rem;
        content: "";
        background: #e56842;
    }
    .fg-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.9rem, 1.8vw, 1.35rem); }
    .fg-vehicle-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .fg-card {
        display: flex;
        flex-direction: column;
        min-width: 0;
        height: 100%;
        overflow: hidden;
        background: #fff;
        border: 1px solid var(--fg-line);
        border-radius: var(--fg-radius);
        box-shadow: 0 5px 18px rgb(18 40 51 / .05);
    }
    .fg-card-media {
        display: block;
        overflow: hidden;
        background: #e9eeee;
        aspect-ratio: 16 / 10;
    }
    .fg-card-media img { width: 100%; height: 100%; object-fit: cover; }
    .fg-card-content { display: flex; flex-direction: column; flex: 1; gap: .62rem; padding: clamp(.85rem, 1.4vw, 1.23rem); }
    .fg-card-content h3 { font-size: clamp(1.1rem, 1.56vw, 1.27rem); font-weight: 760; }
    .fg-card-content h3 a { text-decoration: none; }
    .fg-card-content h3 a:hover { color: var(--fg-accent-deep); text-decoration: underline; }
    .fg-card-content p { color: var(--fg-muted); font-size: .93rem; }
    .fg-card-content .fg-price {
        margin-block-start: auto;
        color: var(--fg-ink);
        font-size: clamp(1.12rem, 1.6vw, 1.45rem);
        font-weight: 800;
        font-variant-numeric: tabular-nums;
    }
    .fg-card-link {
        justify-content: space-between;
        margin-block-start: auto;
        border-top: 1px solid var(--fg-line);
        color: var(--fg-accent-deep);
        padding-block-start: .28rem;
        font-size: .92rem;
    }
    .fg-price + .fg-card-link { margin-block-start: 0; }
    .fg-card-link:hover { text-decoration: underline; }
    .fg-rate-note { color: var(--fg-muted); font-size: .9rem; margin-block: -.3rem .85rem; }

    .fg-about { background: var(--fg-warm); }
    .fg-split { display: grid; grid-template-columns: 1.07fr .93fr; align-items: center; gap: clamp(1.3rem, 3.5vw, 3.2rem); }
    .fg-lead { font-size: clamp(1.02rem, 1.7vw, 1.18rem); font-weight: 660; margin-block-end: .62rem; }
    .fg-split-image { border-radius: var(--fg-radius); overflow: hidden; background: #e7e8e5; }
    .fg-split-image img { width: 100%; object-fit: cover; }
    .fg-split-actions { display: flex; flex-wrap: wrap; gap: .8rem 1.08rem; align-items: center; margin-block-start: 1.2rem; }

    .fg-rail { gap: 1rem; padding: 2px 2px .65rem; scrollbar-color: #81949a #edf1f1; scrollbar-width: thin; }
    .fg-rail > li { min-width: 0; scroll-snap-align: start; }
    .fg-rail-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
    .fg-rail-controls { display: flex; gap: .45rem; flex-shrink: 0; visibility: hidden; }
    .fg-rail-controls[data-fg-visible="true"] { visibility: visible; }
    :is(.fg-rail-controls, .fg-gallery-dialog) button {
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        border: 1px solid var(--fg-line);
        border-radius: .6rem;
        color: var(--fg-ink);
        background: #fff;
    }
    :is(.fg-rail-controls, .fg-gallery-dialog) button:not(:disabled):hover { color: var(--fg-accent-deep); border-color: var(--fg-accent-deep); }
    .fg-rail-controls button[aria-disabled="true"] { opacity: .52; cursor: default; }
    .fg-blog-rail { grid-auto-columns: calc((100% - 2rem) / 3); }
    .fg-reviews { position: relative; isolation: isolate; color: #fff; background: var(--fg-navy); }
    .fg-reviews::after { position: absolute; z-index: -1; inset: 0; content: ""; background: rgb(13 31 42 / .83); }
    .fg-review-inner { max-width: 790px; }
    .fg-review-rail { grid-auto-columns: 100%; }
    .fg-review { display: grid; justify-items: center; gap: .9rem; text-align: center; padding: .35rem .75rem; }
    .fg-avatar { border-radius: 50%; width: 52px; height: 52px; object-fit: cover; }
    .fg-review blockquote { color: #fff; font-size: clamp(1rem, 1.8vw, 1.19rem); }
    .fg-review figcaption { color: var(--fg-peach); font-weight: 750; }
    .fg-review-inner .fg-rail-controls { justify-content: center; margin-block-start: .7rem; }

    .fg-callout { background: var(--fg-warm); }
    .fg-callout-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 290px); gap: 1.3rem; align-items: center; }
    .fg-callout .fg-split-actions { justify-content: flex-end; margin: 0; }
    .fg-gallery-rail { grid-auto-columns: calc((100% - 4rem) / 5); }
    .fg-gallery-rail a {
        display: block;
        position: relative;
        overflow: hidden;
        background: var(--fg-surface);
        border-radius: 12px;
        aspect-ratio: 4 / 3;
    }
    .fg-gallery-rail img { width: 100%; height: 100%; object-fit: cover; }
    .fg-gallery-rail a span {
        position: absolute;
        inset: auto .4rem .4rem auto;
        display: grid;
        place-items: center;
        width: 34px;
        height: 34px;
        border-radius: .45rem;
        background: rgb(19 41 51 / .85);
        color: #fff;
    }
    .fg-gallery-rail a:hover span { background: var(--fg-accent-deep); }
    .fg-gallery-dialog {
        width: min(900px, calc(100% - 2rem));
        max-height: calc(100svh - 2rem);
        padding: 0;
        border: 0;
        border-radius: var(--fg-radius);
        color: var(--fg-ink);
        background: #fff;
    }
    .fg-gallery-dialog::backdrop { background: rgb(8 17 25 / .82); }
    .fg-dialog-inner { display: grid; gap: .5rem; padding: .85rem; }
    .fg-dialog-head, .fg-dialog-controls { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
    .fg-dialog-head h2 { font-size: 1.25rem; }
    .fg-dialog-photo { height: min(65svh, 620px); background: var(--fg-surface); }
    .fg-dialog-photo img { width: 100%; height: 100%; object-fit: contain; }
    .fg-dialog-controls { justify-content: center; }


}

@layer responsive {
    @media (max-width: 1039px) {
        .fg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        .fg-gallery-rail { grid-auto-columns: calc((100% - 2rem) / 3); }
    }
    @media (max-width: 880px) {
        .fg-grid, .fg-vehicle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .fg-blog-rail { grid-auto-columns: calc((100% - 1rem) / 2); }
        .fg-booking-inner, .fg-split, .fg-callout-inner { grid-template-columns: 1fr; }
        .fg-booking-inner { gap: .9rem; }
        .fg-callout .fg-split-actions { justify-content: flex-start; }
    }
    @media (max-width: 620px) {
        body[data-fg-booking-visible="true"] .fg-float { visibility: hidden; }
        .fg-slide { min-height: clamp(375px, 105vw, 455px); align-items: end; }
        .fg-slide-position { padding-block: 62px 68px; justify-content: center; }
        .fg-slide-copy { text-align: center; }
        .fg-slide::after { background: linear-gradient(180deg, rgb(11 20 28 / .02) 0%, rgb(11 20 28 / .28) 27%, rgb(11 20 28 / .82) 62%, rgb(11 20 28 / .91)); }
        .fg-slide-img { object-position: 38% center; }
        .fg-slide-copy :is(h1, h2) { font-size: clamp(2.35rem, 9.7vw, 3.75rem); }
        .fg-hero .fg-rail-controls { inset: auto 50% 12px auto; translate: 50% 0; }
        .fg-hero .fg-rail-controls button { background: #fff; }
        .fg-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .72rem .55rem; }
        .fg-booking-inner { padding-block: 1.2rem 1.05rem; }
        .fg-field :is(label, select) { font-size: .81rem; }
        .fg-book-button { font-size: .83rem; padding-inline: .6rem; }
        .fg-blog-rail { grid-auto-columns: min(86%, 360px); }
        .fg-gallery-rail { grid-auto-columns: min(47%, 240px); }
    }
    @media (max-width: 510px) {
        .fg-grid, .fg-vehicle-grid { grid-template-columns: 1fr; }
    }
    @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
    }
}
