/* ─────────────────────────────────────────────
   InkWell Blog — Main Stylesheet
───────────────────────────────────────────── */
:root {
  --ink: #0f0d0a;
  --paper: #faf8f3;
  --cream: #f2ede2;
  --gold: #c8962a;
  --gold-light: #e8b84b;
  --muted: #8a8070;
  --border: #e0d8c8;
  --white: #ffffff;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;
  --max-w: 1280px;
  --radius: 4px;
}

*, *::before, *::after { 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.6; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* ── TOP BAR ── */
.topbar { background: var(--ink); color: var(--cream); text-align: center; padding: 8px 20px; font-size: 0.75rem; letter-spacing: 0.1em; }

/* ── HEADER ── */
header { background: var(--paper); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 16px rgba(0,0,0,0.06); }
.header-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon { width: 38px; height: 38px; background: var(--ink); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.logo-text { font-family: var(--font-display); font-size: 1.5rem; font-weight: 900; color: var(--ink); letter-spacing: -0.02em; }
.logo-text span { color: var(--gold); }
nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
nav a { font-size: 0.78rem; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: var(--radius); white-space: nowrap; transition: color 0.2s, background 0.2s; }
nav a:hover, nav a.active { color: var(--ink); background: var(--cream); }
nav a.active { font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.search-form { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; background: var(--paper); }
.search-form input { border: none; background: transparent; padding: 7px 14px; font-size: 0.82rem; font-family: var(--font-body); color: var(--ink); outline: none; width: 160px; }
.search-form button { background: var(--ink); border: none; padding: 7px 12px; cursor: pointer; font-size: 0.82rem; transition: background 0.2s; }
.search-form button:hover { background: var(--gold); }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 4px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: all 0.3s; }

/* ── MOBILE NAV ── */
.mobile-nav { display: none; position: fixed; top: 68px; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--border); padding: 16px 24px; flex-direction: column; gap: 4px; z-index: 99; box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.mobile-nav.open { display: flex; }
.mobile-nav a { font-size: 0.95rem; font-weight: 500; color: var(--ink); text-decoration: none; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.mobile-nav a:last-child { border-bottom: none; }

/* ── HERO ── */
.hero { background: var(--ink); color: var(--paper); overflow: hidden; }
.hero-grid { max-width: var(--max-w); margin: 0 auto; display: grid; grid-template-columns: 1fr 400px; min-height: 480px; }
.hero-content { padding: 56px 48px 56px 24px; display: flex; flex-direction: column; justify-content: center; }
.hero-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 16px; }
.hero-tag::before { content: ''; display: block; width: 28px; height: 1px; background: var(--gold); }
.hero h1 { font-family: var(--font-display); font-size: clamp(2rem, 3.5vw, 3.2rem); font-weight: 900; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 16px; }
.hero h1 em { font-style: italic; color: var(--gold-light); }
.hero p { color: #c0b8a8; font-size: 0.95rem; line-height: 1.75; max-width: 460px; margin-bottom: 24px; }
.hero-meta { display: flex; align-items: center; gap: 14px; font-size: 0.75rem; color: #8a8070; flex-wrap: wrap; }
.btn-primary { display: inline-flex; align-items: center; gap: 8px; background: var(--gold); color: var(--ink); text-decoration: none; padding: 11px 24px; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; border-radius: var(--radius); margin-bottom: 24px; width: fit-content; transition: background 0.2s, transform 0.15s; }
.btn-primary:hover { background: var(--gold-light); transform: translateY(-1px); }
.hero-image-panel { background: linear-gradient(135deg,#1a1610,#2d2418); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.hero-image-panel img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; }
.hero-image-panel .hero-thumb-placeholder { font-size: 8rem; opacity: 0.15; }
.hero-image-panel .hero-badge { position: absolute; bottom: 24px; left: 20px; background: rgba(255,255,255,0.07); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 12px 16px; display: flex; gap: 20px; }
.hero-badge .stat-num { font-family: var(--font-display); font-size: 1.3rem; font-weight: 900; color: var(--gold); display: block; }
.hero-badge .stat-lbl { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em; color: #6a6050; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 700; color: #fff; flex-shrink: 0; background: var(--gold); color: var(--ink); }

/* ── AD BANNER ── */
.ad-banner { background: var(--cream); border-bottom: 1px solid var(--border); padding: 12px 24px; text-align: center; }
.ad-label { font-size: 0.62rem; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }

/* ── MAIN BODY ── */
.site-body { max-width: var(--max-w); margin: 0 auto; padding: 52px 24px; display: grid; grid-template-columns: 1fr 300px; gap: 52px; align-items: start; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.section-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 900; }
.section-title span { color: var(--gold); }
.view-all { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); text-decoration: none; }
.view-all:hover { color: var(--ink); }

/* ── POSTS GRID ── */
.posts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 48px; }
.posts-grid-3 { grid-template-columns: repeat(3, 1fr); }
.posts-grid .card-featured { grid-column: 1 / -1; }

/* ── CARD ── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; transition: transform 0.25s, box-shadow 0.25s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 36px rgba(0,0,0,0.09); }
.card-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--cream); display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--muted); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb-wide { aspect-ratio: 21/9; font-size: 4.5rem; }
.card-body { padding: 18px; }
.card-tag { display: inline-block; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); background: rgba(200,150,42,0.1); padding: 2px 9px; border-radius: 20px; margin-bottom: 10px; text-decoration: none; }
.card-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; line-height: 1.3; color: var(--ink); margin-bottom: 8px; text-decoration: none; display: block; transition: color 0.2s; }
.card:hover .card-title { color: var(--gold); }
.card-title-lg { font-size: 1.45rem; }
.card-excerpt { font-size: 0.855rem; color: var(--muted); line-height: 1.7; margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-excerpt-3 { -webkit-line-clamp: 3; }
.card-footer { display: flex; align-items: center; justify-content: space-between; font-size: 0.72rem; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--border); }
.card-author { display: flex; align-items: center; gap: 7px; }

/* ── POST LIST (sidebar/more) ── */
.post-list { display: flex; flex-direction: column; }
.post-item { display: grid; grid-template-columns: 90px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.post-item:hover .pi-title { color: var(--gold); }
.post-thumb-sm { width: 90px; height: 64px; border-radius: var(--radius); background: var(--cream); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; overflow: hidden; flex-shrink: 0; }
.post-thumb-sm img { width: 100%; height: 100%; object-fit: cover; }
.pi-cat { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); margin-bottom: 3px; }
.pi-title { font-family: var(--font-display); font-size: 0.88rem; font-weight: 700; line-height: 1.3; margin-bottom: 4px; transition: color 0.2s; }
.pi-meta { font-size: 0.68rem; color: var(--muted); }

/* ── PAGINATION ── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 36px; flex-wrap: wrap; }
.pg-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.82rem; font-weight: 500; text-decoration: none; color: var(--ink); background: var(--white); transition: all 0.2s; }
.pg-btn.active, .pg-btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pg-btn.disabled { opacity: 0.35; pointer-events: none; }

/* ── SINGLE POST ── */
.post-hero { background: var(--ink); padding: 56px 24px; }
.post-hero-inner { max-width: 780px; margin: 0 auto; color: var(--paper); }
.post-content-wrap { max-width: var(--max-w); margin: 0 auto; padding: 48px 24px; display: grid; grid-template-columns: 1fr 280px; gap: 52px; align-items: start; }
.post-content { max-width: 720px; }
.post-content h2, .post-content h3 { font-family: var(--font-display); margin: 28px 0 14px; }
.post-content p { margin-bottom: 18px; line-height: 1.85; font-size: 1.02rem; color: #2a2820; }
.post-content ul, .post-content ol { margin: 0 0 18px 24px; }
.post-content li { margin-bottom: 6px; line-height: 1.7; }
.post-content blockquote { border-left: 4px solid var(--gold); padding: 12px 20px; background: var(--cream); margin: 24px 0; font-style: italic; color: var(--muted); }
.post-content img { border-radius: 8px; margin: 20px 0; }
.post-content code { background: var(--cream); padding: 2px 6px; border-radius: 3px; font-size: 0.88rem; }
.post-content pre { background: var(--ink); color: var(--paper); padding: 20px; border-radius: 8px; overflow-x: auto; margin: 20px 0; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.post-tag { font-size: 0.72rem; color: var(--muted); border: 1px solid var(--border); padding: 4px 12px; border-radius: 20px; text-decoration: none; transition: all 0.2s; }
.post-tag:hover { border-color: var(--gold); color: var(--gold); }

/* ── CATEGORY HERO ── */
.cat-hero { background: var(--ink); padding: 52px 24px; position: relative; overflow: hidden; }
.cat-hero-inner { max-width: var(--max-w); margin: 0 auto; position: relative; z-index: 1; }
.cat-breadcrumb { font-size: 0.72rem; color: rgba(255,255,255,0.4); margin-bottom: 14px; }
.cat-breadcrumb a { color: rgba(255,255,255,0.4); text-decoration: none; }
.cat-hero h1 { font-family: var(--font-display); font-size: clamp(2.2rem, 4vw, 3.5rem); font-weight: 900; color: #fff; margin-bottom: 12px; }
.cat-hero h1 em { font-style: italic; color: var(--gold-light); }
.cat-hero p { color: rgba(255,255,255,0.5); max-width: 480px; font-size: 0.95rem; line-height: 1.7; }
.cat-stats { display: flex; gap: 28px; margin-top: 24px; }
.cat-stat .num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 900; color: var(--gold); display: block; }
.cat-stat .lbl { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.3); }
.cat-bg-icon { position: absolute; right: 60px; top: 50%; transform: translateY(-50%); font-size: 14rem; opacity: 0.06; user-select: none; }

/* ── FILTER STRIP ── */
.filter-strip { background: var(--white); border-bottom: 1px solid var(--border); padding: 0 24px; overflow-x: auto; scrollbar-width: none; }
.filter-strip::-webkit-scrollbar { display: none; }
.filter-inner { max-width: var(--max-w); margin: 0 auto; display: flex; align-items: center; gap: 0; }
.filter-btn { padding: 14px 18px; font-size: 0.76rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s; white-space: nowrap; font-family: var(--font-body); }
.filter-btn.active { color: var(--ink); border-bottom-color: var(--gold); }
.filter-btn:hover { color: var(--ink); }

/* ── SIDEBAR ── */
.sidebar { display: flex; flex-direction: column; gap: 28px; }
.sw { background: var(--white); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.sw-header { background: var(--ink); color: var(--paper); padding: 11px 16px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.sw-body { padding: 16px; }
.nl-form { display: flex; flex-direction: column; gap: 8px; }
.nl-form p { font-size: 0.82rem; color: var(--muted); line-height: 1.6; margin-bottom: 4px; }
.nl-form input { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font-body); font-size: 0.82rem; background: var(--paper); color: var(--ink); outline: none; transition: border-color 0.2s; }
.nl-form input:focus { border-color: var(--gold); }
.nl-form button { padding: 10px; background: var(--gold); color: var(--ink); border: none; border-radius: var(--radius); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; font-family: var(--font-body); transition: background 0.2s; }
.nl-form button:hover { background: var(--gold-light); }
.cat-list { list-style: none; }
.cat-list li { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.cat-list li:last-child { border-bottom: none; }
.cat-list a { text-decoration: none; color: var(--ink); transition: color 0.2s; }
.cat-list a:hover { color: var(--gold); }
.cat-count { background: var(--cream); color: var(--muted); font-size: 0.65rem; font-weight: 600; padding: 2px 7px; border-radius: 20px; }
.tags-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill { font-size: 0.68rem; color: var(--muted); border: 1px solid var(--border); padding: 3px 10px; border-radius: 20px; text-decoration: none; transition: all 0.2s; }
.tag-pill:hover { border-color: var(--gold); color: var(--gold); }

/* ── FOOTER ── */
footer { background: var(--ink); color: var(--paper); padding: 56px 24px 28px; }
.footer-grid { max-width: var(--max-w); margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand p { margin-top: 12px; font-size: 0.85rem; color: #8a8070; line-height: 1.7; max-width: 260px; }
.footer-social { display: flex; gap: 14px; margin-top: 16px; }
.footer-social a { font-size: 0.78rem; color: #5a5040; text-decoration: none; transition: color 0.2s; }
.footer-social a:hover { color: var(--gold); }
.footer-col h4 { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { font-size: 0.85rem; color: #8a8070; text-decoration: none; transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--paper); }
.footer-bottom { max-width: var(--max-w); margin: 0 auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; color: #5a5040; flex-wrap: wrap; gap: 10px; }

/* ── TOPICS STRIP ── */
.topics-strip { background: var(--ink); padding: 44px 24px; }
.topics-strip h2 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 900; color: var(--paper); margin-bottom: 20px; }
.topics-strip h2 span { color: var(--gold); }
.topics-grid { max-width: var(--max-w); margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.topic-pill { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; padding: 14px 10px; text-align: center; cursor: pointer; transition: all 0.2s; text-decoration: none; color: var(--paper); }
.topic-pill:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.topic-pill .ti { font-size: 1.5rem; display: block; margin-bottom: 5px; }
.topic-pill .tn { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.topics-inner { max-width: var(--max-w); margin: 0 auto; }

/* ── SEARCH ── */
.search-hero { background: var(--ink); padding: 44px 24px; text-align: center; }
.search-hero h1 { font-family: var(--font-display); font-size: 2.4rem; font-weight: 900; color: #fff; margin-bottom: 20px; }
.search-hero h1 span { color: var(--gold); }
.search-big { display: flex; max-width: 560px; margin: 0 auto; border-radius: 8px; overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.search-big input { flex: 1; padding: 14px 20px; font-size: 1rem; border: none; font-family: var(--font-body); outline: none; }
.search-big button { padding: 14px 24px; background: var(--gold); border: none; font-weight: 700; font-size: 0.9rem; cursor: pointer; font-family: var(--font-body); }

/* ── ALERTS ── */
.alert { padding: 12px 18px; border-radius: var(--radius); font-size: 0.88rem; margin-bottom: 16px; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.alert-error   { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.alert-info    { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }

/* ── AD PLACEHOLDER ── */
.ad-placeholder { background: #f0ece3; border: 1px dashed #c8bfa8; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.75rem; }

/* ── ANIMATIONS ── */
@keyframes fadeUp { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }
.fade-in { animation: fadeUp 0.5s ease both; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  nav { display: none; }
  .hamburger { display: flex; }
  .search-form { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-image-panel { display: none; }
  .site-body { grid-template-columns: 1fr; }
  .post-content-wrap { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .posts-grid-3 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
  .posts-grid, .posts-grid-3 { grid-template-columns: 1fr; }
  .posts-grid .card-featured { grid-column: auto; }
  .sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .cat-bg-icon { display: none; }
  .cat-stats { gap: 18px; }
}
