:root {
    /* Yılmazköy Ortaokulu — logo renkleri */
    --navy: #0a2540;
    --navy-deep: #061a2e;
    --green: #2d8a3e;
    --green-dark: #1f6b2d;
    --green-soft: rgba(45, 138, 62, 0.12);
    --ink: #0a2540;
    --paper: #f4f7f5;
    --paper-deep: #e8eef0;
    --leaf: var(--green);
    --leaf-dark: var(--navy);
    --clay: var(--green);
    --line: rgba(10, 37, 64, 0.12);
    --shadow: 0 14px 32px rgba(10, 37, 64, 0.08);
    --radius: 16px;
    --font-display: Georgia, "Times New Roman", serif;
    --font-body: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    color: var(--ink);
    font-family: var(--font-body);
    background:
        radial-gradient(1000px 480px at 8% -8%, rgba(45, 138, 62, 0.14), transparent 58%),
        radial-gradient(800px 360px at 100% 0%, rgba(10, 37, 64, 0.08), transparent 52%),
        linear-gradient(180deg, #f8fbf9 0%, var(--paper) 45%, #e9eef1 100%);
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { color: var(--navy); }

.wrap {
    width: min(1080px, calc(100% - 1.5rem));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: #fff;
    border-bottom: 3px solid var(--green);
    box-shadow: 0 4px 18px rgba(10, 37, 64, 0.06);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0;
    flex-wrap: nowrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: inherit;
    min-width: 0;
}

.brand-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}
.brand-text strong {
    font-family: var(--font-display);
    font-size: 1.08rem;
    color: var(--navy);
}
.brand-text small {
    color: rgba(10, 37, 64, 0.65);
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-left: auto;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    z-index: 60;
}
.nav-toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    margin: 0 auto;
    background: var(--navy);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-backdrop {
    display: none;
}

.nav-drawer-head {
    display: none;
}

/* Masaüstü: JS menüyü header-inner içine taşır */
.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    align-items: center;
    justify-content: flex-end;
}
.nav a {
    padding: 0.4rem 0.25rem;
    border-bottom: 2px solid transparent;
    font-size: 0.92rem;
    color: var(--navy);
}
.nav a.is-active {
    border-color: var(--green);
    color: var(--green-dark);
    font-weight: 700;
}
.nav a:hover { color: var(--green); }

@media (min-width: 761px) {
    .header-inner .nav {
        display: block;
        flex: 1;
        min-width: 0;
        margin-left: 0.5rem;
    }
    .nav-drawer-head,
    .nav-backdrop {
        display: none !important;
    }
}

/* JS yüklenene kadar mobilde menüyü gizle (flash yok) */
body:not(.nav-ready) .nav {
    visibility: hidden;
}
@media (min-width: 761px) {
    body:not(.nav-ready) .nav {
        visibility: visible;
    }
}

.site-main { padding: 1.5rem 0 2.75rem; }

.hero {
    display: grid;
    gap: 1.1rem;
    padding: 1.5rem;
    border-radius: calc(var(--radius) + 4px);
    background:
        linear-gradient(135deg, rgba(10, 37, 64, 0.06), transparent 48%),
        linear-gradient(180deg, #ffffff, var(--paper-deep));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
}

/* Ana sayfa hero: metin + hareketli kitap */
.hero-home {
    grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr);
    align-items: center;
    gap: 1.25rem 1.75rem;
    overflow: hidden;
}

.hero-home-copy .hero-home-amac {
    margin: 0.85rem 0 0;
    max-width: 36rem;
    line-height: 1.55;
    color: rgba(10, 37, 64, 0.78);
}

.hero-home-copy .actions {
    margin-top: 1.15rem;
}

.hero-book-scene {
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 0.5rem 1.5rem;
}

.hero-book {
    position: relative;
    display: block;
    width: min(210px, 58vw);
    text-decoration: none;
    color: inherit;
    transform: rotate(7deg);
    animation: hero-book-sway 7s ease-in-out infinite;
    z-index: 2;
}

.hero-book-shadow {
    position: absolute;
    inset: 8% -6% -10% 8%;
    background: rgba(10, 37, 64, 0.12);
    border-radius: 8px 14px 14px 8px;
    transform: skewY(-2deg);
    z-index: 0;
}

.hero-book-cover {
    position: relative;
    z-index: 1;
    display: block;
    aspect-ratio: 3 / 4;
    border-radius: 4px 12px 12px 4px;
    background:
        linear-gradient(105deg, rgba(255, 255, 255, 0.08) 0%, transparent 28%),
        linear-gradient(180deg, #1a4d3d 0%, #143d30 55%, #0f3228 100%);
    box-shadow:
        inset 3px 0 0 rgba(255, 248, 230, 0.12),
        10px 16px 28px rgba(10, 37, 64, 0.18);
    border: 1px solid rgba(15, 50, 40, 0.35);
}

.hero-book-frame {
    position: absolute;
    inset: 9%;
    border: 1.5px solid rgba(245, 240, 225, 0.55);
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.65rem 0.55rem;
    color: #f5f0e1;
}

.hero-book-kicker {
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
    opacity: 0.9;
    margin-bottom: 0.55rem;
}

.hero-book-title {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 3.2vw, 1.75rem);
    line-height: 1.15;
    font-weight: 700;
    margin-bottom: 0.65rem;
}

.hero-book-line {
    font-size: 0.68rem;
    line-height: 1.4;
    opacity: 0.88;
    max-width: 11em;
}

.hero-book-foot {
    margin-top: auto;
    padding-top: 0.75rem;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    opacity: 0.75;
}

.hero-float-pill {
    position: absolute;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(10, 37, 64, 0.12);
    box-shadow: 0 8px 18px rgba(10, 37, 64, 0.08);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.92rem;
    color: var(--navy);
    animation: hero-float 5.5s ease-in-out infinite;
}

.hero-float-a {
    top: 8%;
    right: 6%;
    animation-delay: 0s;
}

.hero-float-b {
    bottom: 14%;
    left: 2%;
    animation-delay: -1.8s;
}

.hero-float-c {
    bottom: 8%;
    right: 4%;
    animation-delay: -3.2s;
}

.hero-float-star {
    position: absolute;
    top: 12%;
    left: 10%;
    z-index: 3;
    width: 1.35rem;
    height: 1.35rem;
    background: var(--green-dark);
    clip-path: polygon(
        50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%,
        50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%
    );
    animation: hero-spin-soft 12s linear infinite;
}

@keyframes hero-book-sway {
    0%, 100% { transform: rotate(7deg) translateY(0); }
    50% { transform: rotate(4deg) translateY(-8px); }
}

@keyframes hero-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes hero-spin-soft {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 860px) {
    .hero-home {
        grid-template-columns: 1fr;
    }
    .hero-book-scene {
        order: -1;
        min-height: 240px;
        padding-bottom: 0.5rem;
    }
    .hero-book {
        width: min(180px, 52vw);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-book,
    .hero-float-pill,
    .hero-float-star {
        animation: none !important;
    }
}

.hero h1 {
    margin: 0 0 0.4rem;
    font-family: var(--font-display);
    font-size: clamp(1.65rem, 4vw, 2.45rem);
    line-height: 1.15;
    color: var(--navy);
}

.hero .lede {
    margin: 0;
    max-width: 42rem;
    font-size: 1.05rem;
    line-height: 1.55;
    color: rgba(10, 37, 64, 0.8);
}

.hero-kelime {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}
.hero-kelime-main .actions {
    margin-top: 1rem;
}
.hero-kelime-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.35rem;
    padding: 0.75rem 0.85rem 0.9rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(10, 37, 64, 0.06);
    min-width: 148px;
}
.hero-kelime-qr img {
    width: 148px;
    height: 148px;
    max-width: 100%;
    display: block;
    border-radius: 8px;
}
.hero-kelime-qr strong {
    font-size: 0.9rem;
    color: var(--navy);
}
.hero-kelime-qr small {
    font-size: 0.72rem;
    line-height: 1.35;
    color: rgba(10, 37, 64, 0.55);
    max-width: 11rem;
}

@media (max-width: 760px) {
    .hero-kelime {
        grid-template-columns: 1fr;
    }
    .hero-kelime-qr {
        justify-self: center;
    }
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 0.82rem;
    font-weight: 600;
}

.panel {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.1rem;
}

.panel h2 {
    margin: 0 0 0.7rem;
    font-size: 1.2rem;
    color: var(--navy);
    font-family: var(--font-display);
}

.panel p, .panel li { line-height: 1.6; }

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem;
}

.search-bar {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.search-bar input[type="search"],
input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    color: inherit;
}

textarea { min-height: 110px; resize: vertical; }
.search-bar input[type="search"] { flex: 1; min-width: 180px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    border: 1px solid transparent;
    background: var(--navy);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
}
.btn:hover { background: var(--navy-deep); color: #fff; }

.btn-secondary {
    background: #fff;
    border-color: var(--line);
    color: var(--navy);
}
.btn-secondary:hover {
    border-color: var(--green);
    color: var(--green-dark);
    background: var(--green-soft);
}

.btn-speak {
    background: var(--green);
    color: #fff;
}
.btn-speak:hover { background: var(--green-dark); color: #fff; }

.btn-speak-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
    border-radius: 999px;
}

.btn-danger { background: #8b2e2e; }
.btn-danger:hover { background: #6d2222; }

.speak-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-top: 0.65rem;
}

.word-list { list-style: none; margin: 0; padding: 0; }
.word-list li { border-top: 1px solid var(--line); }
.word-list li:first-child { border-top: 0; }
.word-list a {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0.1rem;
    color: inherit;
}
.word-list a:hover .word-title { color: var(--green); }
.word-title { font-weight: 700; font-size: 1.12rem; color: var(--navy); }
.word-meta { color: rgba(10, 37, 64, 0.58); font-size: 0.88rem; }

.alpha-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 1rem;
}
.alpha-jump a {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--green-soft);
    color: var(--navy);
    font-size: 0.85rem;
    font-weight: 700;
}

.letter-group {
    margin: 1.4rem 0 0.45rem;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--green-dark);
    font-weight: 700;
}

.media-block {
    margin-top: 0.85rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #fff;
}
.media-block img,
.media-block video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
    background: #f7faf8;
}
.media-caption {
    padding: 0.55rem 0.8rem;
    font-size: 0.85rem;
    color: rgba(10, 37, 64, 0.65);
    border-top: 1px solid var(--line);
}

.site-footer {
    border-top: 3px solid var(--navy);
    padding: 1.25rem 0 2rem;
    background: linear-gradient(180deg, #eef3f6, #e4ebf0);
}
.footer-brand {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}
.footer-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}
.footer-inner p { margin: 0.25rem 0; }
.muted { color: rgba(10, 37, 64, 0.6); font-size: 0.9rem; }

.alert {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}
.alert-ok { background: var(--green-soft); border: 1px solid rgba(45, 138, 62, 0.3); }
.alert-err { background: rgba(139, 46, 46, 0.1); border: 1px solid rgba(139, 46, 46, 0.25); }

.form-grid { display: grid; gap: 0.9rem; }
.form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.92rem;
}
.form-hint { font-size: 0.82rem; color: rgba(10, 37, 64, 0.55); margin-top: 0.25rem; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}
table.data th, table.data td {
    text-align: left;
    padding: 0.7rem 0.5rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
table.data th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(10, 37, 64, 0.6);
}

.actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.9rem;
}
.qr-card {
    text-align: center;
    padding: 0.9rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    break-inside: avoid;
}
.qr-card img { width: 132px; height: 132px; max-width: 100%; }
.qr-card strong { display: block; margin-top: 0.55rem; color: var(--navy); }
.qr-card small {
    display: block;
    word-break: break-all;
    color: rgba(10, 37, 64, 0.5);
    margin-top: 0.25rem;
    font-size: 0.7rem;
}

.kaynakca-kimlik {
    margin-top: 2rem;
    text-align: right;
    font-size: 0.95rem;
    line-height: 1.5;
}

.steps { margin: 0; padding-left: 1.2rem; }
.steps li { margin-bottom: 0.4rem; }

.admin-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.hero-logo {
    width: min(120px, 28vw);
    height: auto;
    display: block;
    margin-bottom: 0.5rem;
}

@media (max-width: 760px) {
    .grid-2 { grid-template-columns: 1fr; }

    .nav-toggle { display: inline-flex; }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(6, 26, 46, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
        z-index: 90;
    }
    .nav-backdrop.is-open {
        opacity: 1;
        visibility: visible;
    }

    .nav-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
        padding: 1rem 1.1rem 0.85rem;
        border-bottom: 1px solid var(--line);
        color: var(--navy);
        font-family: var(--font-display);
    }
    .nav-close {
        width: 40px;
        height: 40px;
        border: 0;
        background: transparent;
        color: var(--navy);
        font-size: 1.6rem;
        line-height: 1;
        cursor: pointer;
        border-radius: 10px;
    }
    .nav-close:hover { background: var(--green-soft); }

    .nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(300px, 86vw);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin: 0;
        padding: 0 0 calc(1rem + env(safe-area-inset-bottom, 0px));
        background: #fff;
        box-shadow: -8px 0 28px rgba(6, 26, 46, 0.18);
        transform: translateX(105%);
        transition: transform 0.28s ease;
        z-index: 100;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        pointer-events: none;
    }
    .nav.is-open {
        transform: translateX(0);
        pointer-events: auto;
    }
    .nav-links {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .nav a {
        padding: 0.95rem 1.15rem;
        border-bottom: 1px solid var(--line);
        border-left: 3px solid transparent;
        font-size: 1rem;
    }
    .nav a.is-active {
        border-left-color: var(--green);
        border-bottom-color: var(--line);
        background: var(--green-soft);
        color: var(--green-dark);
    }

    body.nav-open {
        overflow: hidden;
    }

    .site-main { padding: 1rem 0 2rem; }
    .hero, .panel { padding: 1.05rem; }
    .btn { min-height: 44px; }
    .brand-logo { width: 44px; height: 44px; }
}

@media print {
    .site-header, .site-footer, .no-print, .nav-toggle, .nav, .nav-backdrop { display: none !important; }
    body { background: #fff; }
    .panel, .hero, .qr-card { box-shadow: none; }
    .site-main { padding: 0; }
}
