/* ============================================================
   DAILYLEARN.BLOG  —  Editorial design system
   Display: Fraunces · Body: Inter · Labels: Space Mono
   ============================================================ */

:root {
  --paper:      #FAF8F3;
  --paper-2:    #F2EEE6;
  --ink:        #1C1A17;
  --ink-soft:   #55504A;
  --line:       #E2DCD0;
  --card:       #FFFFFF;
  --accent:     #E24E2B;   /* signature vermilion-coral */
  --accent-2:   #14524B;   /* deep pine — secondary */
  --gold:       #C99A2E;
  --shadow:     0 1px 2px rgba(28,26,23,.04), 0 8px 30px rgba(28,26,23,.06);
  --shadow-lg:  0 20px 60px rgba(28,26,23,.14);
  --radius:     14px;
  --maxw:       1200px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'Space Mono', monospace;
}

[data-theme="dark"] {
  --paper:    #14130F;
  --paper-2:  #1D1B16;
  --ink:      #F3EFE7;
  --ink-soft: #A9A296;
  --line:     #33302A;
  --card:     #1B1915;
  --shadow:   0 1px 2px rgba(0,0,0,.3), 0 10px 34px rgba(0,0,0,.35);
  --shadow-lg:0 24px 70px rgba(0,0,0,.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* selection */
::selection { background: var(--accent); color: #fff; }

/* ---------- eyebrow / mono labels ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

/* ============ HEADER ============ */
.topbar {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .05em;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 38px; }
.topbar .date { text-transform: uppercase; opacity: .85; }
.lang-switch { display: flex; gap: 2px; align-items: center; }
.lang-switch a {
  padding: 3px 9px; border-radius: 6px; opacity: .7; transition: .2s;
}
.lang-switch a:hover, .lang-switch a.active { opacity: 1; background: rgba(255,255,255,.14); }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 76px; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand .logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 27px;
  letter-spacing: -.02em;
  font-optical-sizing: auto;
}
.brand .logo b { color: var(--accent); }
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display:inline-block; margin-bottom:3px; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.8)} }

.main-nav { display: flex; gap: 4px; margin-inline-start: auto; }
.main-nav a {
  padding: 9px 14px; border-radius: 9px; font-weight: 500; font-size: 15px;
  color: var(--ink-soft); transition: .2s;
}
.main-nav a:hover { color: var(--ink); background: var(--paper-2); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer; font-size: 17px;
  display: grid; place-items: center; transition: .2s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.menu-toggle { display: none; }

/* search overlay */
.search-overlay {
  position: fixed; inset: 0; z-index: 200; background: color-mix(in srgb, var(--ink) 55%, transparent);
  backdrop-filter: blur(6px); display: none; align-items: flex-start; justify-content: center; padding-top: 14vh;
}
.search-overlay.open { display: flex; }
.search-box { width: min(640px, 90vw); background: var(--card); border-radius: 16px; padding: 10px; box-shadow: var(--shadow-lg); display: flex; gap: 8px; }
.search-box input {
  flex: 1; border: 0; background: transparent; color: var(--ink); font-size: 19px;
  font-family: var(--font-body); padding: 14px 16px; outline: none;
}
.search-box button { border: 0; background: var(--accent); color: #fff; border-radius: 12px; padding: 0 26px; font-weight: 600; cursor: pointer; }

/* ============ HERO ============ */
.hero { padding: 46px 0 30px; }
.hero-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 26px; }
.hero-lead {
  position: relative; border-radius: var(--radius); overflow: hidden;
  min-height: 460px; display: flex; align-items: flex-end; box-shadow: var(--shadow);
}
.hero-lead img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-lead::after { content:''; position:absolute; inset:0; background: linear-gradient(180deg, transparent 30%, rgba(10,8,6,.9) 100%); }
.hero-lead .content { position: relative; z-index: 2; padding: 34px; color: #fff; }
.hero-lead h1 {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05; letter-spacing: -.02em; margin: 12px 0 10px; text-wrap: balance;
}
.hero-lead p { opacity: .9; font-size: 16px; max-width: 60ch; }

.hero-side { display: flex; flex-direction: column; gap: 18px; }
.mini-card { display: flex; gap: 16px; align-items: flex-start; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.mini-card:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-card .num { font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--line); line-height: 1; min-width: 42px; }
.mini-card h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.mini-card:hover h3 { color: var(--accent); }
.mini-card .meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); margin-top: 6px; letter-spacing: .04em; }

.cat-chip {
  display: inline-block; font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 30px;
  color: #fff; background: var(--accent);
}

/* ============ SECTION HEAD ============ */
.section { padding: 44px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; border-bottom: 2px solid var(--ink); padding-bottom: 14px; }
.section-head h2 { font-family: var(--font-display); font-size: clamp(24px, 3vw, 34px); font-weight: 700; letter-spacing: -.02em; }
.section-head a.more { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }

/* ============ ARTICLE CARDS ============ */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .3s cubic-bezier(.2,.7,.3,1), box-shadow .3s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card .thumb { aspect-ratio: 16/10; overflow: hidden; position: relative; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card:hover .thumb img { transform: scale(1.06); }
.card .thumb .cat-chip { position: absolute; top: 12px; inset-inline-start: 12px; }
.card .body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.22; letter-spacing: -.01em; }
.card:hover h3 { color: var(--accent); }
.card p { color: var(--ink-soft); font-size: 14.5px; flex: 1; }
.card .foot { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); letter-spacing: .03em; padding-top: 6px; border-top: 1px solid var(--line); }

/* ============ CATEGORY STRIP ============ */
.cat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-tile {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--card);
  transition: .25s; position: relative; overflow: hidden;
}
.cat-tile::before { content:''; position:absolute; inset-inline-start:0; top:0; bottom:0; width:5px; background: var(--c, var(--accent)); }
.cat-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cat-tile .emoji { font-size: 30px; }
.cat-tile h3 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin: 8px 0 3px; }
.cat-tile .count { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-soft); letter-spacing: .05em; }

/* ============ AD SLOT ============ */
.ad-slot {
  margin: 34px auto; text-align: center; min-height: 90px; display: grid; place-items: center;
  border: 1px dashed var(--line); border-radius: 12px; color: var(--ink-soft);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; background: var(--paper-2);
}
.ad-slot span { opacity: .5; }

/* ============ NEWSLETTER ============ */
.newsletter { background: var(--ink); color: var(--paper); border-radius: 22px; padding: 52px; text-align: center; position: relative; overflow: hidden; }
.newsletter::before { content:'✦'; position:absolute; font-size: 260px; opacity:.05; top: -60px; inset-inline-end: -30px; font-family: var(--font-display); }
.newsletter h2 { font-family: var(--font-display); font-size: clamp(26px,3.5vw,40px); font-weight: 800; letter-spacing: -.02em; }
.newsletter p { opacity: .8; margin: 10px auto 24px; max-width: 44ch; }
.news-form { display: flex; gap: 10px; max-width: 480px; margin: 0 auto; }
.news-form input { flex: 1; border: 0; border-radius: 12px; padding: 15px 18px; font-size: 15px; font-family: var(--font-body); }
.news-form button { border: 0; background: var(--accent); color: #fff; border-radius: 12px; padding: 0 28px; font-weight: 700; cursor: pointer; transition: .2s; }
.news-form button:hover { filter: brightness(1.08); }

/* ============ SINGLE POST ============ */
.article-head { max-width: 820px; margin: 40px auto 0; text-align: center; }
.article-head h1 { font-family: var(--font-display); font-size: clamp(30px, 5vw, 54px); font-weight: 800; line-height: 1.06; letter-spacing: -.025em; margin: 18px 0; text-wrap: balance; }
.article-meta { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); letter-spacing: .05em; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.article-cover { max-width: 1000px; margin: 34px auto; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 16/8; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-body { max-width: 720px; margin: 0 auto; font-size: 19px; line-height: 1.8; }
.article-body p { margin: 0 0 24px; color: var(--ink); }
.article-body h2 { font-family: var(--font-display); font-size: 30px; font-weight: 700; margin: 40px 0 14px; letter-spacing: -.02em; }
.article-body h3 { font-family: var(--font-display); font-size: 24px; font-weight: 600; margin: 30px 0 10px; }
.article-body img { border-radius: 12px; margin: 24px 0; }
.article-body ul, .article-body ol { margin: 0 0 24px; padding-inline-start: 26px; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote { border-inline-start: 4px solid var(--accent); background: var(--paper-2); padding: 18px 24px; margin: 28px 0; border-radius: 0 12px 12px 0; font-family: var(--font-display); font-style: italic; font-size: 22px; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body code { background: var(--paper-2); padding: 2px 7px; border-radius: 5px; font-family: var(--font-mono); font-size: .85em; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; max-width: 720px; margin: 34px auto; }
.tag { font-family: var(--font-mono); font-size: 12px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 30px; color: var(--ink-soft); }
.share-row { max-width: 720px; margin: 0 auto 20px; display: flex; gap: 10px; align-items: center; font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }
.share-row a { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; display: grid; place-items: center; transition: .2s; }
.share-row a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ============ PAGE HEADER (category/search) ============ */
.page-hero { text-align: center; padding: 56px 0 30px; }
.page-hero h1 { font-family: var(--font-display); font-size: clamp(32px, 5vw, 56px); font-weight: 800; letter-spacing: -.025em; }
.page-hero p { color: var(--ink-soft); margin-top: 10px; }

/* ============ FOOTER ============ */
.site-footer { background: var(--ink); color: var(--paper); margin-top: 60px; padding: 60px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 40px; }
.footer-grid h4 { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; opacity: .6; margin-bottom: 16px; }
.footer-brand .logo { font-family: var(--font-display); font-size: 26px; font-weight: 900; }
.footer-brand .logo b { color: var(--accent); }
.footer-brand p { opacity: .7; margin-top: 12px; font-size: 14px; max-width: 34ch; }
.footer-links a { display: block; opacity: .75; padding: 5px 0; font-size: 14.5px; transition: .2s; }
.footer-links a:hover { opacity: 1; color: var(--accent); padding-inline-start: 5px; }
.social-row { display: flex; gap: 10px; margin-top: 4px; }
.social-row a { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; display: grid; place-items: center; transition: .2s; }
.social-row a:hover { background: var(--accent); border-color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 44px; padding-top: 22px; display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; opacity: .6; flex-wrap: wrap; gap: 10px; }

/* ============ PAGINATION ============ */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 44px; font-family: var(--font-mono); }
.pagination a, .pagination span { padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; transition: .2s; }
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ============ EMPTY / 404 ============ */
.empty { text-align: center; padding: 80px 20px; }
.empty .big { font-family: var(--font-display); font-size: 90px; font-weight: 800; color: var(--accent); }

/* ============ RESPONSIVE ============ */
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .cat-strip { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}
@media (max-width: 680px) {
  .main-nav { display: none; }
  .menu-toggle { display: grid; }
  .main-nav.open {
    display: flex; position: absolute; top: 76px; inset-inline: 0; flex-direction: column;
    background: var(--card); border-bottom: 1px solid var(--line); padding: 12px; gap: 4px;
  }
  .main-nav.open a { padding: 12px; }
  .grid, .grid.two { grid-template-columns: 1fr; }
  .cat-strip { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .newsletter { padding: 34px 22px; }
  .news-form { flex-direction: column; }
  .article-body { font-size: 17px; }
  .topbar .date { display: none; }
}

/* RTL tweaks */
[dir="rtl"] .mini-card .num { transform: scaleX(-1); }
[dir="rtl"] .article-body blockquote { border-radius: 12px 0 0 12px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
