/* Сарказам.мк: newspaper meets coffee shop. Mobile first. */

@font-face { font-family: 'Literata'; font-style: normal; font-weight: 200 900; font-display: swap; src: url('fonts/literata-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Literata'; font-style: normal; font-weight: 200 900; font-display: swap; src: url('fonts/literata-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Literata'; font-style: italic; font-weight: 200 900; font-display: swap; src: url('fonts/literata-italic-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Literata'; font-style: italic; font-weight: 200 900; font-display: swap; src: url('fonts/literata-italic-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 200 900; font-display: swap; src: url('fonts/unbounded-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 200 900; font-display: swap; src: url('fonts/unbounded-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    --espresso: #2b1b17;
    --roast: #6b3e26;
    --crema: #f5e9da;
    --paper: #fffbf5;
    --ink: #1d1411;
    --muted: #7a6a62;
    --line: #e6d8c6;
    --red: #e63b2e;
    --red-dark: #b8291f;
    --mustard: #f2b705;
    --green: #2e8b57;
    --radius: 14px;
    --shadow: 0 1px 0 rgba(43, 27, 23, .06), 0 6px 24px -12px rgba(43, 27, 23, .25);
    --display: 'Unbounded', 'Segoe UI', system-ui, sans-serif;
    --serif: 'Literata', Georgia, 'Times New Roman', serif;
    --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.0625rem;
    line-height: 1.6;
    font-kerning: normal;
    text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: rgba(230, 59, 46, .5); text-underline-offset: .18em; }
a:hover { color: var(--red-dark); }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
.sr, .skip:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: var(--mustard); padding: .5em 1em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* ── Reading progress ─────────────────────────────────────────── */
.progress { position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 50; background: transparent; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--roast), var(--red)); transition: width .1s linear; }

/* ── Masthead ─────────────────────────────────────────────────── */
.masthead { text-align: center; padding: 1rem 1rem 0; border-bottom: 3px double var(--espresso); background: var(--paper); }
.masthead__top { display: flex; justify-content: space-between; gap: 1rem; font-family: var(--sans); font-size: .8rem; color: var(--muted); text-transform: lowercase; max-width: 1100px; margin: 0 auto; }
.masthead__random { text-decoration: none; }
.logo { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--espresso); margin-top: .4rem; }
.logo img { width: 52px; height: 52px; transition: transform .3s; }
.logo:hover img { transform: rotate(-12deg); }
.logo__text { font-family: var(--display); font-weight: 800; font-size: clamp(1.8rem, 7vw, 3.2rem); letter-spacing: -.02em; }
.logo__tld { color: var(--red); }
.tagline { margin: .1rem 0 .6rem; font-style: italic; color: var(--roast); }
.nav { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; padding: .5rem 0; max-width: 1100px; margin: 0 auto; border-top: 1px solid var(--line); font-family: var(--sans); font-size: .9rem; -webkit-overflow-scrolling: touch; }
.nav::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; text-decoration: none; padding: .35rem .7rem; border-radius: 999px; }
.nav a:hover { background: var(--crema); color: var(--ink); }
@media (min-width: 900px) { .nav { justify-content: center; } }

/* ── Page ─────────────────────────────────────────────────────── */
.page { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin: 1.1rem 0; box-shadow: var(--shadow); }
.section-title { font-family: var(--display); font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; text-transform: uppercase; color: var(--espresso); }
.kicker { display: inline-block; font-family: var(--sans); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--red); text-decoration: none; }
.byline { font-family: var(--sans); font-size: .8rem; color: var(--muted); margin: .4rem 0 0; }
.byline a { text-decoration: none; }
.big-quote { font-size: 1.2rem; line-height: 1.45; margin: .2rem 0 .8rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.duo { display: grid; gap: 0 1.1rem; }
@media (min-width: 760px) { .duo { grid-template-columns: 1fr 1fr; } }
.inline-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-family: var(--sans); font-size: .9rem; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; font: 600 .95rem/1.2 var(--sans); padding: .65em 1.1em; border-radius: 999px; border: 2px solid var(--espresso); background: var(--espresso); color: var(--paper); text-decoration: none; cursor: pointer; transition: transform .08s, background .2s; margin: .2rem .2rem .2rem 0; }
.btn:hover { background: var(--roast); color: #fff; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn--ghost { background: transparent; color: var(--espresso); }
.btn--ghost:hover { background: var(--crema); color: var(--espresso); }
.btn--big { font-size: 1.05rem; padding: .85em 1.5em; background: var(--red); border-color: var(--red); }
.btn--big:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn--small { font-size: .8rem; padding: .3em .7em; }

/* ── Edition ──────────────────────────────────────────────────── */
.edition-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .3rem 1rem; font-family: var(--sans); font-size: .85rem; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.edition-head p { margin: 0; }
.edition-head__no strong { color: var(--red); font-size: 1.05rem; }
.front { display: grid; gap: 1rem; margin-top: 1rem; }
@media (min-width: 860px) { .front { grid-template-columns: 1.6fr 1fr; } }
.front__rest { display: grid; gap: 1rem; align-content: start; }
.teaser { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.teaser:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -14px rgba(43, 27, 23, .4); }
.teaser__link { text-decoration: none; display: block; }
.teaser__title { font-size: 1.15rem; margin: .3rem 0; }
.teaser__title--lead { font-family: var(--display); font-weight: 800; font-size: clamp(1.45rem, 4.4vw, 2.3rem); letter-spacing: -.02em; line-height: 1.12; }
.teaser--lead { background: var(--espresso); color: var(--paper); border-color: var(--espresso); padding: 1.4rem; position: relative; overflow: hidden; }
.teaser--lead::after { content: "☕"; position: absolute; right: -10px; bottom: -28px; font-size: 9rem; opacity: .08; transform: rotate(-15deg); }
.teaser--lead .kicker { color: var(--mustard); }
.teaser--lead .byline { color: #cdb9a8; }
.teaser--lead .teaser__lead { font-size: 1.1rem; color: #f0e3d4; }
.teaser__lead { margin: .3rem 0 0; color: #4a3b35; }

.news__list { list-style: none; counter-reset: n; padding: 0; margin: 0; }
.news__item { counter-increment: n; position: relative; padding: .75rem 0 .75rem 2.4rem; border-top: 1px dashed var(--line); }
.news__item::before { content: counter(n); position: absolute; left: 0; top: .75rem; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--crema); color: var(--espresso); font: 800 .8rem/1.7rem var(--display); text-align: center; }
.news__title { font-weight: 700; text-decoration: none; }
.news__src { font-family: var(--sans); font-size: .75rem; color: var(--muted); margin-left: .3rem; white-space: nowrap; }
.news__comment { margin: .35rem 0 0; padding: .45rem .8rem; background: #fff6d6; border-left: 4px solid var(--mustard); border-radius: 0 10px 10px 0; font-style: italic; }

.quiz-cta { background: linear-gradient(135deg, #fff 0%, #fff6d6 100%); }

/* Poll */
.poll__q { font-size: 1.2rem; font-weight: 700; margin: .2rem 0 .8rem; }
.poll__options { display: grid; gap: .5rem; }
.poll__option { text-align: left; font: 500 1rem/1.35 var(--sans); padding: .75rem 1rem; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; transition: border-color .15s, background .15s; }
.poll__option:hover { border-color: var(--red); background: #fff; }
.poll__results { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.poll__result { position: relative; display: flex; justify-content: space-between; gap: 1rem; padding: .6rem .9rem; border-radius: 10px; background: var(--crema); overflow: hidden; font-family: var(--sans); }
.poll__bar { position: absolute; inset: 0 auto 0 0; width: var(--pct); background: rgba(242, 183, 5, .45); transition: width .6s ease; }
.poll__result.is-mine .poll__bar { background: rgba(230, 59, 46, .3); }
.poll__label, .poll__pct { position: relative; }
.poll__pct { font-weight: 800; }

/* Weather */
.weather__grid { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.weather__city { display: grid; grid-template-columns: auto 1fr auto; gap: 0 .6rem; align-items: center; padding: .6rem .7rem; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.weather__emoji { font-size: 1.6rem; grid-row: span 2; }
.weather__name { font-weight: 700; font-family: var(--sans); }
.weather__temp { font: 800 1.05rem var(--display); }
.weather__temp small { font-weight: 500; color: var(--muted); font-size: .75rem; }
.weather__text { grid-column: 2 / span 2; font-size: .9rem; color: #4a3b35; }

/* Horoscope */
.horoscope__grid { display: grid; gap: .45rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.sign { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.sign[open] { grid-column: 1 / -1; background: #fff; border-color: var(--mustard); }
.sign summary { cursor: pointer; padding: .55rem .8rem; font-family: var(--sans); font-weight: 700; list-style: none; }
.sign summary::-webkit-details-marker { display: none; }
.sign p { margin: 0 .9rem .7rem; }
.sign__symbol { color: var(--red); font-size: 1.15em; }
.sign__lucky { font-family: var(--sans); font-size: .85rem; color: var(--roast); }
.grid--signs .sign-card h2 { font-family: var(--display); font-size: 1.1rem; }

/* Coffee */
.coffee { text-align: center; background: var(--espresso); color: var(--paper); border: 0; padding: 1.6rem 1.2rem; }
.coffee .muted { color: #cdb9a8; }
.coffee__ask { font-size: 1.1rem; max-width: 34rem; margin: 0 auto 1rem; }
.coffee__cup { font-size: 3.4rem; animation: steam 2.4s ease-in-out infinite; }
.coffee h2 { font-family: var(--display); font-size: 1.5rem; }
.coffee__streak strong { font: 800 2.2rem var(--display); color: var(--mustard); }
.coffee__badge { display: inline-block; background: rgba(255, 255, 255, .08); padding: .4rem .9rem; border-radius: 999px; }
.coffee__badge.is-new { background: var(--mustard); color: var(--espresso); animation: pop .5s ease; }
.coffee .share__btn { background: rgba(255, 255, 255, .1); color: var(--paper); border-color: transparent; }
@keyframes steam { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-4px) rotate(3deg); } }
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* ── Article ──────────────────────────────────────────────────── */
.article { max-width: 720px; margin: 1rem auto; }
.article__head { border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 1.2rem; }
.article__title { font-family: var(--display); font-weight: 800; font-size: clamp(1.6rem, 5vw, 2.5rem); letter-spacing: -.02em; line-height: 1.12; margin-top: .5rem; }
.article__lead { font-size: 1.2rem; font-style: italic; color: #4a3b35; margin: 0; }
.article__body p { margin: 0 0 1.05em; }
.article__body p:first-child::first-letter { font-family: var(--display); font-weight: 800; float: left; font-size: 3.2em; line-height: .9; padding: .05em .1em 0 0; color: var(--red); }
.article__disclaimer { font-family: var(--sans); font-size: .8rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: .8rem; margin-top: 1.5rem; }
.prose .article__body p:first-child::first-letter { all: unset; }
.prose h2 { font-family: var(--display); font-size: 1.15rem; margin-top: 1.5rem; }
.stamp { display: inline-block; margin-left: .6rem; padding: .05rem .5rem; border: 2px solid var(--red); color: var(--red); font: 800 .7rem/1.4 var(--display); letter-spacing: .12em; transform: rotate(-4deg); border-radius: 4px; vertical-align: middle; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag { font-family: var(--sans); font-size: .8rem; background: var(--crema); padding: .15rem .6rem; border-radius: 999px; }
.related { margin-top: 2rem; }

/* Reactions */
.reactions { margin: 1.6rem 0 1rem; text-align: center; }
.reactions__title { font-family: var(--display); font-size: 1rem; text-transform: uppercase; }
.reactions__row { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; }
.reaction { display: inline-flex; flex-direction: column; align-items: center; min-width: 4rem; padding: .45rem .6rem; border: 2px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; font-family: var(--sans); transition: transform .1s, border-color .15s; }
.reaction:hover { transform: translateY(-2px) scale(1.05); border-color: var(--mustard); }
.reaction.is-mine { border-color: var(--red); background: #fff1ee; }
.reaction__emoji { font-size: 1.7rem; line-height: 1.1; }
.reaction__count { font-weight: 800; font-size: .85rem; }
.reactions__note { font-family: var(--sans); font-size: .8rem; color: var(--muted); }

/* Share */
.share { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin: 1rem 0; }
.share__btn { font: 600 .82rem/1 var(--sans); padding: .55em .9em; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; }
.share__btn:hover { border-color: var(--espresso); }
.share__viber { background: #7360f2; color: #fff; border-color: #7360f2; }
.share__wa { background: #25d366; color: #073; border-color: #25d366; }
.share__fb { background: #1877f2; color: #fff; border-color: #1877f2; }
.share--compact { justify-content: center; }

/* Quiz */
.quiz__q { border: 1px solid var(--line); }
.quiz__n { font: 800 .8rem var(--display); color: var(--red); padding: 0 .3rem; }
.quiz__headline { font-size: 1.15rem; font-weight: 700; margin: .2rem 0 .7rem; }
.quiz__choices { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; text-align: center; padding: .7rem; border: 2px solid var(--line); border-radius: 12px; font-family: var(--sans); font-weight: 700; cursor: pointer; background: var(--paper); }
.choice input:checked + span { border-color: var(--red); background: #fff1ee; }
.choice input:focus-visible + span { outline: 3px solid var(--mustard); }
.quiz-result { text-align: center; }
.quiz-result__score { font: 800 3.4rem var(--display); color: var(--red); margin: 0; }
.quiz-result__grid { font-size: 2rem; letter-spacing: .2rem; margin: .3rem 0; }
.quiz-answers { list-style: none; padding: 0; }
.quiz-answer { border-left: 6px solid var(--line); }
.quiz-answer.is-right { border-left-color: var(--green); }
.quiz-answer.is-wrong { border-left-color: var(--red); }

/* Lists, archive, search, empty */
.listing-head { margin: 1rem 0; }
.listing-head h1 { font-family: var(--display); font-weight: 800; font-size: clamp(1.5rem, 5vw, 2.2rem); }
.archive { list-style: none; padding: 0; columns: 2 280px; font-family: var(--sans); }
.archive li { break-inside: avoid; padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.archive a { text-decoration: none; }
.search { display: flex; gap: .5rem; max-width: 540px; }
.search input { flex: 1; font: 1rem var(--sans); padding: .65rem 1rem; border: 2px solid var(--line); border-radius: 999px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin: 1.5rem 0; font-family: var(--sans); }
.empty { text-align: center; padding: 2.5rem 1rem; }
.empty__cup { font-size: 4rem; }
.empty h1 { font-family: var(--display); }

/* Footer */
.footer { margin-top: 3rem; background: var(--espresso); color: #e9dccd; padding: 2rem 1rem; font-family: var(--sans); font-size: .9rem; }
.footer > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
.footer__satire { border: 1px dashed rgba(255, 255, 255, .25); border-radius: var(--radius); padding: 1rem; }
.footer__links { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }
.footer__links a { color: var(--mustard); }
.footer__small { color: #a8968a; font-size: .8rem; }

/* ── Admin ────────────────────────────────────────────────────── */
.admin { font-family: var(--sans); font-size: .95rem; }
.admin__bar { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; padding: .7rem 1rem; background: var(--espresso); color: var(--paper); }
.admin__bar a { color: var(--paper); text-decoration: none; }
.admin__bar nav { display: flex; flex-wrap: wrap; gap: 1rem; flex: 1; }
.admin__brand { font-family: var(--display); font-weight: 800; }
.admin__bar .btn--ghost { color: var(--paper); border-color: var(--paper); }
.admin__main { max-width: 1300px; margin: 0 auto; padding: 1rem; }
.admin h1 { font-family: var(--display); font-size: 1.5rem; }
.admin-cols { display: grid; gap: 0 1rem; }
@media (min-width: 1000px) { .admin-cols { grid-template-columns: 1fr 1fr; } }
.stats { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; }
.stat strong { display: block; font: 800 1.8rem var(--display); }
.stat.is-warn { border-color: var(--red); background: #fff1ee; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr.is-muted { opacity: .5; }
.inline { display: inline-flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters select, .filters input, .editor input, .editor textarea, .editor select, .admin-login input, .inline input { font: inherit; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.editor { display: grid; gap: .8rem; }
.editor label, .admin-login label { display: grid; gap: .25rem; font-weight: 600; }
.editor textarea { font-family: var(--serif); line-height: 1.5; }
.editor__row { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.wide { min-width: 22rem; }
.alert { background: #fff1ee; border: 1px solid var(--red); padding: .6rem .9rem; border-radius: 10px; }
.alert--ok { background: #eefaf2; border-color: var(--green); }
.admin-login { max-width: 380px; margin: 3rem auto; display: grid; gap: .8rem; }
.admin-login form { display: grid; gap: .8rem; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
    .masthead__top, .nav, .progress, .share, .reactions, .coffee, .footer__links { display: none !important; }
}
