/* ===========================================================================
   BOGA Core — base.css
   Tüm tema SİTE yüzlerinin paylaştığı yapısal katman.
   Burada RENK PALETİ TANIMLANMAZ; her tema kendi değişkenlerini theme.css
   içinde tanımlar. Buradaki renk kullanımları yalnızca `currentColor` ve
   temanın tanımlaması beklenen değişkenlere yapılan geri dönüşlü atıflardır.
   =========================================================================== */

/* ------------------------------------------------------------------ sıfırlama */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
    scroll-behavior: smooth;
    /* Yapışkan başlığın altında kalmayan çapa hedefleri */
    scroll-padding-top: var(--header-height, 72px);
}

body {
    min-height: 100svh;
    line-height: 1.65;
    font-family: var(--font-body, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* Yatay kaydırma kilidi: hiçbir bölüm sayfayı yana kaydıramaz. */
    overflow-x: hidden;
}

html,
body {
    max-width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    text-wrap: balance;
    font-weight: 700;
}

p, li, dd, figcaption {
    text-wrap: pretty;
}

/* Kırılmayan uzun kelimeler / adresler taşma yapmasın */
p, li, h1, h2, h3, h4, td, th, dd, dt, figcaption, blockquote {
    overflow-wrap: break-word;
}

ul[role="list"],
ol[role="list"] {
    list-style: none;
    padding: 0;
}

img, svg, video, canvas, audio, iframe, embed, object {
    display: block;
    max-width: 100%;
}

img, video {
    height: auto;
}

img {
    /* Yüklenene kadar düzeni bozmasın */
    background-repeat: no-repeat;
    background-size: cover;
    font-style: italic;
    shape-margin: 0.75rem;
}

svg {
    flex: none;
}

.icon {
    display: inline-block;
    vertical-align: -0.15em;
}

input, button, textarea, select {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
}

button {
    background: none;
    border: 0;
    cursor: pointer;
}

button:disabled,
[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.6;
}

a {
    color: inherit;
    text-decoration-thickness: from-font;
    text-underline-offset: 0.2em;
}

table {
    border-collapse: collapse;
    width: 100%;
}

hr {
    border: 0;
    border-top: 1px solid currentColor;
    opacity: 0.15;
}

fieldset {
    border: 0;
    padding: 0;
}

textarea {
    resize: vertical;
}

summary {
    cursor: pointer;
}

::selection {
    background: var(--selection-bg, color-mix(in srgb, currentColor 22%, transparent));
    color: var(--selection-fg, inherit);
}

/* ------------------------------------------------------------------- odaklanma */
:focus-visible {
    outline: 2px solid var(--focus-ring, currentColor);
    outline-offset: 3px;
    border-radius: var(--focus-radius, 4px);
}

:focus:not(:focus-visible) {
    outline: none;
}

/* Klavyeyle gezinenler için içerik atlama bağlantısı */
.skip-link {
    position: absolute;
    left: 12px;
    top: -100px;
    z-index: 9999;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--surface, #111);
    color: var(--text, #fff);
    transition: top 0.18s ease;
}

.skip-link:focus-visible {
    top: 12px;
}

/* --------------------------------------------------------------- kapsayıcılar */
.container {
    width: 100%;
    max-width: var(--container, 1200px);
    margin-inline: auto;
    padding-inline: var(--gutter, 20px);
}

.container-sm { --container: 760px; }
.container-md { --container: 980px; }
.container-lg { --container: 1200px; }
.container-xl { --container: 1400px; }
.container-full { --container: 100%; }

@media (max-width: 480px) {
    .container { --gutter: 16px; }
}

/* ------------------------------------------------------------- erişilebilirlik */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.sr-only-focusable:focus-visible {
    position: static !important;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: normal;
}

[hidden] {
    display: none !important;
}

.no-scroll {
    overflow: hidden;
    /* Modal açıkken sayfanın zıplamasını engeller */
    touch-action: none;
}

/* --------------------------------------------------------------- animasyonlar */
@keyframes boga-fade-up {
    from { opacity: 0; transform: translate3d(0, 24px, 0); }
    to { opacity: 1; transform: none; }
}

@keyframes boga-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes boga-zoom-in {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: none; }
}

@keyframes boga-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -12px, 0); }
}

@keyframes boga-shimmer {
    from { background-position: -180% 0; }
    to { background-position: 180% 0; }
}

@keyframes boga-marquee {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-50%, 0, 0); }
}

@keyframes boga-spin {
    to { transform: rotate(360deg); }
}

@keyframes boga-pulse-ring {
    0% { transform: scale(0.9); opacity: 0.7; }
    70% { transform: scale(1.5); opacity: 0; }
    100% { opacity: 0; }
}

.anim-float { animation: boga-float 5s ease-in-out infinite; }
.anim-spin { animation: boga-spin 1s linear infinite; }
.anim-fade-in { animation: boga-fade-in 0.5s ease both; }

/* Yükleme parıltısı (iskelet değil, gerçek içerik gelene kadar arka plan) */
.shimmer {
    background-image: linear-gradient(
        100deg,
        transparent 20%,
        color-mix(in srgb, currentColor 12%, transparent) 40%,
        transparent 60%
    );
    background-size: 200% 100%;
    animation: boga-shimmer 1.6s linear infinite;
}

/* Sonsuz kayan şerit: içeriği iki kez basın (.marquee > .marquee-track > 2 kopya) */
.marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: boga-marquee var(--marquee-duration, 30s) linear infinite;
}

.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track {
    animation-play-state: paused;
}

/* ---------------------------------------------------- kaydırmayla ortaya çıkma */
/* app.js IntersectionObserver ile .is-visible sınıfını ekler.
   JS kapalıysa .no-js kuralı içeriği görünür bırakır (içerik asla kaybolmaz). */
.reveal {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
    transition:
        opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}

.reveal-left { transform: translate3d(-28px, 0, 0); }
.reveal-right { transform: translate3d(28px, 0, 0); }
.reveal-zoom { transform: scale(0.94); }
.reveal-fade { transform: none; }

.reveal.is-visible {
    opacity: 1;
    transform: none;
    will-change: auto;
}

/* Sıralı gecikme yardımcıları */
.reveal-d1 { --reveal-delay: 80ms; }
.reveal-d2 { --reveal-delay: 160ms; }
.reveal-d3 { --reveal-delay: 240ms; }
.reveal-d4 { --reveal-delay: 320ms; }
.reveal-d5 { --reveal-delay: 400ms; }

html.no-js .reveal {
    opacity: 1;
    transform: none;
}

/* Yazdırma ve betik çalışmayan ortamlarda gizli kalmasın. */
@media print {
    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}

@media (scripting: none) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ------------------------------------------------------------ yıldız bileşeni */
/* helpers.php > star_rating() bu yapıyı üretir:
   <span class="stars"><span class="star" style="--fill:60%"><svg …/></span>…</span>
   Kısmi dolgu, yıldız biçimine kırpılmış bir degrade ile sağlanır. */
.stars {
    display: inline-flex;
    align-items: center;
    gap: 0.12em;
    line-height: 1;
    color: var(--star-color, currentColor);
    vertical-align: middle;
}

.star {
    position: relative;
    display: inline-block;
}

.star::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        var(--star-color, currentColor) var(--fill, 0%),
        var(--star-empty, transparent) var(--fill, 0%)
    );
    clip-path: polygon(
        50% 2%, 61.8% 35.4%, 97.6% 35.4%, 68.6% 56.6%,
        79.4% 90.4%, 50% 69.6%, 20.6% 90.4%, 31.4% 56.6%,
        2.4% 35.4%, 38.2% 35.4%
    );
}

.star svg {
    position: relative;
    display: block;
}

/* --------------------------------------------------------------- yardımcılar */
.stack > * + * { margin-top: var(--stack-gap, 1rem); }

.flow > * + * { margin-top: var(--flow-gap, 1.1em); }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clamp-2,
.clamp-3,
.clamp-4 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }
.clamp-4 { -webkit-line-clamp: 4; line-clamp: 4; }

.ratio {
    position: relative;
    aspect-ratio: var(--ratio, 16 / 9);
    overflow: hidden;
}

.ratio > img,
.ratio > video,
.ratio > iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Uzun tablolar / kod blokları kendi içinde kaysın */
.scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

/* Uzak bölümlerde çizim maliyetini düşürür */
.defer-paint {
    content-visibility: auto;
    contain-intrinsic-size: auto 600px;
}

/* -------------------------------------------------------------- hareket azaltma */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .marquee-track {
        animation: none;
    }
}

/* -------------------------------------------------------------------- baskı */
@media print {
    .no-print,
    header nav,
    .to-top,
    .modal {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
    }
}
