/* =========================================================
   ORV Türkçe — Wiki/Sözlük stylesheet
   Theme: dark space, cyan accents, matches landing.css
   ========================================================= */

/* Scroll fix (override landing.css overflow:hidden + 100dvw causing h-scroll) */
html, body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100vw;
}
.content-container {
    height: auto !important;
    min-height: 100dvh;
    overflow: visible !important;
    width: 100%;
}
.top-group {
    overflow: visible !important;
    align-items: stretch !important;
    max-width: 1200px !important;   /* override landing.css 900px so wiki can breathe */
    width: 100%;
}

/* ---------- Layout shell ---------- */
.wiki-shell {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem 4rem;
    color: rgba(255,255,255,0.9);
}

.wiki-header {
    text-align: center;
    margin: 1.5rem 0 1rem;
}

.wiki-header h1 {
    color: white;
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    margin-bottom: 0.3rem;
    letter-spacing: 0.5px;
}

.wiki-header .subtitle {
    color: rgba(255,255,255,0.55);
    font-size: clamp(0.85rem, 2vw, 1rem);
    margin-bottom: 0.6rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.9em;
    margin: 1em 0 0.5em;
    transition: color 0.25s;
}
.back-link:hover { color: #00d4ff; }
.back-link svg { fill: currentColor; }

/* ---------- Spoiler warning banner ---------- */
.spoiler-warning {
    background: linear-gradient(135deg, rgba(255,69,69,0.08), rgba(255,69,69,0.04));
    border: 1px solid rgba(255,69,69,0.3);
    border-radius: 10px;
    padding: 0.75em 1em;
    margin: 0 auto 1.2em;
    color: rgba(255,255,255,0.85);
    font-size: 0.85em;
    text-align: center;
    max-width: 800px;
    backdrop-filter: blur(6px);
}

/* ---------- Search bar ---------- */
.wiki-search-wrap {
    position: relative;
    max-width: 600px;
    margin: 0 auto 1rem;
}

.wiki-search {
    width: 100%;
    padding: 0.75em 1em 0.75em 2.7em;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 10px;
    background: rgba(0,0,0,0.4);
    color: white;
    font-size: 0.95em;
    backdrop-filter: blur(8px);
    transition: border-color 0.25s, box-shadow 0.25s;
}

.wiki-search:focus {
    outline: none;
    border-color: rgba(0,212,255,0.6);
    box-shadow: 0 0 0 4px rgba(0,212,255,0.08);
}

.wiki-search::placeholder { color: rgba(255,255,255,0.45); }

.wiki-search-wrap::before {
    content: "";
    position: absolute;
    left: 0.9em;
    top: 50%;
    width: 1.1em;
    height: 1.1em;
    transform: translateY(-50%);
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960' fill='rgba(255,255,255,0.5)'><path d='M796-121 533-384q-30 26-69.96 40.5T378-329q-108.16 0-183.08-75Q120-479 120-585t75-181q75-75 181.5-75t181 75Q632-691 632-584.85 632-542 618-502q-14 40-42 75l264 262-44 44ZM377-389q81.25 0 138.13-57.5Q572-504 572-585t-56.87-138.5Q458.25-781 377-781q-82.08 0-139.54 57.5Q180-666 180-585t57.46 138.5Q294.92-389 377-389Z'/></svg>") no-repeat center / contain;
    pointer-events: none;
}

/* ---------- Category filter tabs ---------- */
.wiki-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0 1.5rem;
}

.wiki-tab {
    padding: 0.45em 1em;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.75);
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.25s;
    backdrop-filter: blur(5px);
}

.wiki-tab:hover {
    border-color: rgba(0,212,255,0.4);
    color: white;
}

.wiki-tab.active {
    background: rgba(0,212,255,0.15);
    border-color: #00d4ff;
    color: #00d4ff;
}

.wiki-tab .count {
    opacity: 0.6;
    margin-left: 0.4em;
    font-size: 0.85em;
}

/* ---------- Card grid ---------- */
.wiki-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.wiki-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.wiki-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0,212,255,0.5);
    box-shadow: 0 8px 24px rgba(0,212,255,0.08);
}

.wiki-card-thumb {
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(167,139,250,0.08));
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

/* Procedural SVG placeholder is applied via JS to .wiki-card-thumb[data-slug] */
.wiki-card-thumb {
    background-size: cover;
    background-position: center;
}

.wiki-card-body {
    padding: 0.8em 1em 1em;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}

.wiki-card h3 {
    font-size: 1em;
    color: white;
    margin: 0;
    line-height: 1.3;
}

.wiki-card .romanized {
    color: rgba(255,255,255,0.45);
    font-size: 0.75em;
    margin-top: -0.1em;
}

.wiki-card .summary {
    color: rgba(255,255,255,0.75);
    font-size: 0.85em;
    line-height: 1.45;
    margin: 0.3em 0 0;
    /* clamp to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Category tag pill */
.wiki-tag {
    display: inline-block;
    padding: 0.15em 0.65em;
    border-radius: 999px;
    font-size: 0.7em;
    font-weight: 600;
    margin-top: 0.5em;
    align-self: flex-start;
    letter-spacing: 0.3px;
}

.tag-character    { background: rgba(0,212,255,0.18);   color: #00d4ff; }
.tag-companion    { background: rgba(81,207,102,0.18);  color: #51cf66; }
.tag-constellation{ background: rgba(255,215,0,0.18);   color: #ffd700; }
.tag-villain      { background: rgba(255,69,69,0.18);   color: #ff6b6b; }
.tag-concept      { background: rgba(200,130,255,0.18); color: #c882ff; }
.tag-event        { background: rgba(167,139,250,0.18); color: #a78bfa; }
.tag-location     { background: rgba(255,165,0,0.18);   color: #ffa500; }
.tag-item         { background: rgba(100,200,255,0.18); color: #64c8ff; }

/* ---------- Empty state ---------- */
.wiki-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3em 1em;
    color: rgba(255,255,255,0.5);
    font-size: 0.9em;
}

/* =========================================================
   Entry detail page
   ========================================================= */

.entry-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem 4rem;
}

.entry-hero {
    display: grid;
    grid-template-columns: minmax(180px, 260px) 1fr;
    gap: 1.5rem;
    margin: 1rem 0 2rem;
    align-items: start;
}

.entry-infobox {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 1em;
    backdrop-filter: blur(8px);
}

.entry-portrait {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(167,139,250,0.1));
    background-size: cover;
    background-position: center;
    margin-bottom: 0.8em;
    border: 1px solid rgba(255,255,255,0.08);
}

.infobox-rows {
    font-size: 0.85em;
    line-height: 1.6;
}

.infobox-rows dt {
    color: rgba(255,255,255,0.5);
    font-size: 0.9em;
    margin-top: 0.5em;
}

.infobox-rows dd {
    color: rgba(255,255,255,0.92);
    margin: 0;
}

.entry-headline h1 {
    font-size: clamp(1.4rem, 4vw, 2rem);
    color: white;
    margin: 0;
    line-height: 1.2;
}

.entry-headline .romanized {
    color: rgba(255,255,255,0.5);
    font-size: 0.95em;
    margin-top: 0.2em;
}

.entry-headline .quick-tags {
    margin-top: 0.7em;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
}

.entry-summary {
    margin-top: 1em;
    color: rgba(255,255,255,0.85);
    font-size: 1em;
    line-height: 1.65;
}

.entry-section {
    margin-top: 2rem;
}

.entry-section h2 {
    color: #00d4ff;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(0,212,255,0.25);
    padding-bottom: 0.4em;
    margin-bottom: 0.8em;
    letter-spacing: 0.3px;
}

.entry-section p {
    color: rgba(255,255,255,0.85);
    line-height: 1.65;
    margin: 0 0 0.8em;
    font-size: 0.95em;
}

/* ---------- Spoiler block ---------- */
.spoiler-block {
    position: relative;
    border: 1px solid rgba(255,69,69,0.35);
    border-radius: 12px;
    padding: 1em 1.2em 1.2em;
    margin-top: 1em;
    background: linear-gradient(135deg, rgba(255,69,69,0.04), rgba(255,69,69,0.02));
}

.spoiler-block .spoiler-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5em;
    margin-bottom: 0.7em;
}

.spoiler-block .spoiler-label {
    color: #ff6b6b;
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.4em;
}

.spoiler-toggle-btn {
    background: transparent;
    border: 1px solid rgba(255,107,107,0.4);
    color: #ff6b6b;
    border-radius: 6px;
    padding: 0.3em 0.8em;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.2s;
}

.spoiler-toggle-btn:hover {
    background: rgba(255,107,107,0.1);
}

.spoiler-content {
    display: none;
    color: rgba(255,255,255,0.88);
    line-height: 1.65;
    font-size: 0.95em;
}

.spoiler-block.revealed .spoiler-content { display: block; }
.spoiler-block.revealed .spoiler-toggle-btn::after { content: " ✕"; }

/* ---------- Gallery ---------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
}

.gallery-item {
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    transition: transform 0.25s, border-color 0.25s;
}

.gallery-item:hover {
    transform: scale(1.03);
    border-color: rgba(0,212,255,0.4);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 0.4em 0.6em;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.8));
    color: white;
    font-size: 0.7em;
    line-height: 1.3;
    opacity: 0;
    transition: opacity 0.25s;
}

.gallery-item:hover .gallery-caption { opacity: 1; }

.gallery-empty {
    color: rgba(255,255,255,0.4);
    font-size: 0.85em;
    font-style: italic;
    padding: 1em;
    text-align: center;
    border: 1px dashed rgba(255,255,255,0.15);
    border-radius: 8px;
}

/* ---------- Lightbox ---------- */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: zoom-out;
}

.lightbox.open { display: flex; }

.lightbox img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 60px rgba(0,212,255,0.15);
}

.lightbox-caption {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.8);
    font-size: 0.9em;
    text-align: center;
    max-width: 80%;
    padding: 0.4em 1em;
    background: rgba(0,0,0,0.5);
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 1.2rem;
    right: 1.5rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    font-size: 1.3em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ---------- Related entries strip ---------- */
.related-strip {
    display: flex;
    gap: 0.7rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.related-strip a {
    flex: 0 0 auto;
    width: 140px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 0.6em 0.8em;
    text-decoration: none;
    color: white;
    font-size: 0.85em;
    transition: all 0.25s;
}

.related-strip a:hover {
    border-color: rgba(0,212,255,0.4);
    background: rgba(0,212,255,0.05);
}

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
    .entry-hero {
        grid-template-columns: 1fr;
    }
    .entry-infobox {
        max-width: 320px;
        margin: 0 auto;
    }
    .wiki-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.7rem;
    }
}
