/* ============================================================
   THEME DEFINITIONS — CSS Custom Properties
   ============================================================ */

:root,
[data-theme="default"] {
  --primary:        #285FF1;
  --primary-hover:  #1a4fd0;
  --bg-page:        #F0F2F5;
  --bg-surface:     #FFFFFF;
  --bg-header:      #1a1f2e;
  --bg-footer:      #1a1f2e;
  --text-strong:    #0f1117;
  --text-medium:    #4a5568;
  --text-weak:      #8a97a8;
  --text-link:      #285FF1;
  --border:         #E2E8F0;
  --radius:         8px;
  --radius-sm:      4px;
  --radius-lg:      12px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow:         0 4px 16px rgba(0,0,0,.1), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:      0 10px 40px rgba(0,0,0,.15), 0 4px 12px rgba(0,0,0,.08);
  --font:           'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display:   'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --header-h:       56px;
  --container:      1200px;
}

[data-theme="dark"] {
  --primary:        #60A5FA;
  --primary-hover:  #3b82f6;
  --bg-page:        #0f1117;
  --bg-surface:     #1a1f2e;
  --bg-header:      #0d1018;
  --bg-footer:      #0d1018;
  --text-strong:    #f0f4f8;
  --text-medium:    #94a3b8;
  --text-weak:      #64748b;
  --text-link:      #60A5FA;
  --border:         #2d3748;
  --radius:         8px;
  --radius-sm:      4px;
  --radius-lg:      12px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow:         0 4px 16px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.3);
  --shadow-lg:      0 10px 40px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.35);
  --font:           'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display:   'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --header-h:       56px;
  --container:      1200px;
}

[data-theme="newspaper"] {
  --primary:        #B91C1C;
  --primary-hover:  #991b1b;
  --bg-page:        #faf6ef;
  --bg-surface:     #fffdf7;
  --bg-header:      #1a0a0a;
  --bg-footer:      #1a0a0a;
  --text-strong:    #1a0a0a;
  --text-medium:    #4a3728;
  --text-weak:      #9a7c6a;
  --text-link:      #B91C1C;
  --border:         #ddd5c8;
  --radius:         4px;
  --radius-sm:      2px;
  --radius-lg:      6px;
  --shadow-sm:      0 1px 3px rgba(100,50,20,.1);
  --shadow:         0 4px 16px rgba(100,50,20,.15);
  --shadow-lg:      0 10px 40px rgba(100,50,20,.2);
  --font:           'Georgia', 'Times New Roman', serif;
  --font-display:   'Georgia', 'Times New Roman', serif;
  --header-h:       56px;
  --container:      1200px;
}

[data-theme="neon"] {
  --primary:        #A855F7;
  --primary-hover:  #9333ea;
  --bg-page:        #070711;
  --bg-surface:     #0e0e1f;
  --bg-header:      #05050f;
  --bg-footer:      #05050f;
  --text-strong:    #e8e0ff;
  --text-medium:    #9b8ec4;
  --text-weak:      #5a4f7a;
  --text-link:      #22d3ee;
  --border:         #1e1a35;
  --radius:         8px;
  --radius-sm:      4px;
  --radius-lg:      12px;
  --shadow-sm:      0 1px 3px rgba(168,85,247,.1), 0 1px 2px rgba(0,0,0,.4);
  --shadow:         0 4px 16px rgba(168,85,247,.15), 0 2px 6px rgba(0,0,0,.5);
  --shadow-lg:      0 10px 40px rgba(168,85,247,.2), 0 4px 12px rgba(0,0,0,.6);
  --font:           'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display:   'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --header-h:       56px;
  --container:      1200px;
}

/* ============================================================
   BASE RESET
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background-color: var(--bg-page);
  color: var(--text-medium);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color .15s ease;
}

a:hover {
  color: var(--primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: var(--font);
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */

.container {
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  padding: 24px 0 48px;
}

/* ============================================================
   SITE HEADER
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-header);
  border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.header-inner {
  display: flex;
  align-items: center;
  height: var(--header-h);
  gap: 20px;
}

.site-logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: white;
  letter-spacing: -.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-logo span {
  color: var(--primary);
}

.header-nav {
  display: flex;
  flex: 1;
  overflow: hidden;
  gap: 2px;
}

.header-nav a {
  color: rgba(255,255,255,.7);
  font-size: .875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.header-nav a:hover,
.header-nav a.active {
  background: rgba(255,255,255,.1);
  color: white;
}

.header-right {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
  align-items: center;
}

.icon-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,.7);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: rgba(255,255,255,.1);
  color: white;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

/* Search Bar */
.header-search {
  display: none;
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 12px 0;
  background: var(--bg-header);
}

.header-search.open {
  display: block;
}

.search-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  color: white;
  font-size: .9rem;
  font-family: var(--font);
  outline: none;
  transition: border-color .15s ease;
}

.search-input::placeholder {
  color: rgba(255,255,255,.35);
}

.search-input:focus {
  border-color: var(--primary);
}

.search-submit {
  height: 40px;
  padding: 0 18px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s ease;
  white-space: nowrap;
}

.search-submit:hover {
  background: var(--primary-hover);
}

/* Theme Picker */
.theme-picker {
  position: absolute;
  top: calc(var(--header-h) + 8px);
  right: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 200;
  min-width: 160px;
}

.theme-picker.open {
  display: block;
}

.theme-picker-title {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-weak);
  padding: 4px 8px 8px;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  color: var(--text-medium);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-family: var(--font);
  text-align: left;
  transition: background .12s ease, color .12s ease;
}

.theme-option:hover {
  background: var(--bg-page);
  color: var(--text-strong);
}

.theme-option.active {
  color: var(--primary);
  font-weight: 600;
}

.theme-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

/* ============================================================
   FEATURED POST
   ============================================================ */

.featured-post {
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 8px;
  background: var(--bg-surface);
  box-shadow: var(--shadow);
  transition: box-shadow .2s ease;
  text-decoration: none;
}

.featured-post:hover {
  box-shadow: var(--shadow-lg);
}

.featured-post__image {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.featured-post__placeholder {
  width: 100%;
  height: 280px;
  background: var(--primary);
  opacity: .3;
}

.featured-post__body {
  padding: 20px;
}

.featured-post__category {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 10px;
}

.featured-post__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1.25;
  margin-bottom: 8px;
  transition: color .15s ease;
}

.featured-post:hover .featured-post__title {
  color: var(--primary);
}

.featured-post__excerpt {
  color: var(--text-medium);
  font-size: .9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
  line-height: 1.6;
}

.featured-post__meta {
  display: flex;
  gap: 8px;
  font-size: .8rem;
  color: var(--text-weak);
  align-items: center;
  flex-wrap: wrap;
}

.featured-post__meta .dot {
  opacity: .4;
}

/* ============================================================
   POSTS FEED
   ============================================================ */

.posts-feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  background: var(--bg-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  transition: box-shadow .2s ease;
  margin-bottom: 10px;
}

.post-card:hover {
  box-shadow: var(--shadow);
}

.post-card__body {
  flex: 1;
  min-width: 0;
}

.post-card__category {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 6px;
}

.post-card__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .15s ease;
}

.post-card:hover .post-card__title {
  color: var(--primary);
}

.post-card__excerpt {
  color: var(--text-medium);
  font-size: .85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
  line-height: 1.55;
}

.post-card__meta {
  display: flex;
  gap: 6px;
  font-size: .78rem;
  color: var(--text-weak);
  align-items: center;
  flex-wrap: wrap;
}

.post-card__meta .dot {
  opacity: .4;
}

.post-card__thumb {
  flex-shrink: 0;
  width: 120px;
  height: 90px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.post-card__thumb-placeholder {
  flex-shrink: 0;
  width: 120px;
  height: 90px;
  border-radius: var(--radius-sm);
  background: var(--border);
  opacity: .5;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.widget {
  background: var(--bg-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.widget-header {
  padding: 12px 16px;
  border-bottom: 2px solid var(--primary);
  background: var(--bg-surface);
}

.widget-title {
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-strong);
}

/* Top Posts */
.top-posts {
  padding: 8px 0;
}

.top-post-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  transition: background .15s ease;
}

.top-post-item:last-child {
  border-bottom: none;
}

.top-post-item:hover {
  background: var(--bg-page);
}

.top-post-number {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--border);
  line-height: 1;
  flex-shrink: 0;
  min-width: 24px;
  text-align: right;
}

.top-post-title {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .15s ease;
}

.top-post-item:hover .top-post-title {
  color: var(--primary);
}

/* Categories List */
.cat-list {
  padding: 8px 0;
}

.cat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  color: var(--text-medium);
  font-size: .875rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.cat-item:last-child {
  border-bottom: none;
}

.cat-item:hover,
.cat-item.active {
  background: var(--bg-page);
  color: var(--primary);
}

.cat-item.active {
  font-weight: 600;
}

.cat-item svg {
  width: 14px;
  height: 14px;
  opacity: .4;
  flex-shrink: 0;
}

.cat-item:hover svg {
  opacity: 1;
}

/* Tag Cloud */
.tag-cloud {
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .78rem;
  color: var(--text-medium);
  text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.tag-pill:hover,
.tag-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============================================================
   PAGINATION
   ============================================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 0;
}

.page-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-medium);
  font-size: .875rem;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.page-btn:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.page-btn:disabled {
  opacity: .4;
  cursor: default;
}

.page-info {
  font-size: .875rem;
  color: var(--text-weak);
}

/* ============================================================
   PAGE HEADER (category / tag pages)
   ============================================================ */

.page-header {
  padding: 24px 0 0;
  border-bottom: 1px solid var(--border);
}

.page-header__breadcrumb {
  font-size: .8rem;
  color: var(--text-weak);
  margin-bottom: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.page-header__breadcrumb a {
  color: var(--text-weak);
  text-decoration: none;
}

.page-header__breadcrumb a:hover {
  color: var(--primary);
}

.page-header__title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 16px;
  font-family: var(--font-display);
  color: var(--text-strong);
}

.page-header__title span {
  color: var(--primary);
}

/* ============================================================
   SINGLE POST LAYOUT
   ============================================================ */

.post-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  padding: 32px 0 64px;
}

.post-hero {
  margin-bottom: 28px;
}

.post-hero__cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.post-hero__category {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 12px;
  text-decoration: none;
}

.post-hero__title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.2;
  color: var(--text-strong);
  margin-bottom: 12px;
}

.post-hero__excerpt {
  font-size: 1.05rem;
  color: var(--text-medium);
  line-height: 1.65;
  margin-bottom: 16px;
}

.post-hero__meta {
  display: flex;
  gap: 10px;
  font-size: .85rem;
  color: var(--text-weak);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: center;
}

.post-hero__meta .dot {
  opacity: .4;
}

.post-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

/* ============================================================
   POST CONTENT
   ============================================================ */

.post-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-medium);
}

.post-content h2 {
  font-family: var(--font-display);
  color: var(--text-strong);
  margin: 1.75em 0 .6em;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
}

.post-content h3 {
  font-family: var(--font-display);
  color: var(--text-strong);
  margin: 1.75em 0 .6em;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
}

.post-content h4 {
  font-family: var(--font-display);
  color: var(--text-strong);
  margin: 1.75em 0 .6em;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
}

.post-content p {
  margin: .9em 0;
}

.post-content img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1.2em 0;
}

.post-content figure {
  margin: 1.5em 0;
}

.post-content figcaption {
  text-align: center;
  font-size: .82rem;
  color: var(--text-weak);
  margin-top: .5em;
}

.post-content ul {
  padding-left: 1.5em;
  margin: .9em 0;
  list-style: disc;
}

.post-content ol {
  padding-left: 1.5em;
  margin: .9em 0;
  list-style: decimal;
}

.post-content li {
  margin: .35em 0;
}

.post-content blockquote {
  border-left: 3px solid var(--primary);
  padding: .75em 1.25em;
  margin: 1.5em 0;
  background: var(--bg-page);
  border-radius: 0 4px 4px 0;
}

.post-content blockquote p {
  color: var(--text-medium);
  font-style: italic;
  margin: 0;
}

.post-content blockquote cite {
  display: block;
  font-size: .85rem;
  color: var(--text-weak);
  margin-top: .5em;
  font-style: normal;
}

.post-content pre {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2em;
  overflow-x: auto;
  font-size: .875rem;
  margin: 1.2em 0;
  line-height: 1.6;
}

.post-content pre code {
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', 'Monaco', monospace;
  color: var(--text-strong);
}

.post-content hr {
  border: none;
  border-top: 2px dashed var(--border);
  margin: 2.5em auto;
  width: 60px;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  margin: 1.2em 0;
}

.post-content td,
.post-content th {
  border: 1px solid var(--border);
  padding: .6em 1em;
  text-align: left;
}

.post-content th {
  background: var(--bg-page);
  font-weight: 700;
  color: var(--text-strong);
}

.post-content .embed {
  position: relative;
  width: 100%;
  margin: 1.5em 0;
}

.post-content .embed iframe {
  width: 100%;
  border-radius: var(--radius);
  border: none;
}

/* ============================================================
   UNLOCK BOX (password protected)
   ============================================================ */

.unlock-box {
  max-width: 440px;
  margin: 60px auto;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  text-align: center;
}

.unlock-box .lock-icon {
  width: 48px;
  height: 48px;
  color: var(--primary);
  margin: 0 auto 16px;
}

.unlock-box h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-strong);
  margin-bottom: 8px;
}

.unlock-box p {
  font-size: .9rem;
  color: var(--text-medium);
  margin-bottom: 20px;
}

.unlock-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-page);
  color: var(--text-strong);
  font-size: .95rem;
  font-family: var(--font);
  margin-bottom: 12px;
  outline: none;
  transition: border-color .15s ease;
}

.unlock-input:focus {
  border-color: var(--primary);
}

.unlock-btn {
  width: 100%;
  height: 44px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s ease;
}

.unlock-btn:hover {
  background: var(--primary-hover);
}

.unlock-error {
  color: #EF4444;
  font-size: .85rem;
  margin-top: 8px;
}

/* ============================================================
   LOADING STATES & SKELETON
   ============================================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--border) 25%,
    var(--bg-page) 50%,
    var(--border) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  background: var(--bg-surface);
  border-radius: var(--radius);
  margin-bottom: 2px;
}

.skeleton-thumb {
  flex-shrink: 0;
  width: 120px;
  height: 90px;
  border-radius: var(--radius-sm);
}

.skeleton-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.skeleton-line {
  height: 14px;
  border-radius: var(--radius-sm);
}

.skeleton-line--short { width: 40%; }
.skeleton-line--med   { width: 70%; }
.skeleton-line--full  { width: 100%; }
.skeleton-line--badge { width: 60px; height: 18px; }

/* ============================================================
   SITE FOOTER
   ============================================================ */

.site-footer {
  background: var(--bg-footer);
  color: rgba(255,255,255,.6);
  margin-top: 32px;
  border-top: 1px solid rgba(255,255,255,.05);
}

.footer-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px;
  padding: 40px 0;
}

.footer-col-title {
  color: white;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 14px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-links a {
  color: rgba(255,255,255,.55);
  font-size: .85rem;
  text-decoration: none;
  transition: color .15s ease;
}

.footer-links a:hover {
  color: white;
}

.footer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.footer-tag {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  font-size: .75rem;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.footer-tag:hover {
  background: rgba(255,255,255,.12);
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8rem;
  color: rgba(255,255,255,.3);
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bottom a {
  color: rgba(255,255,255,.4);
  text-decoration: none;
}

.footer-bottom a:hover {
  color: rgba(255,255,255,.7);
}

/* ============================================================
   UTILITY
   ============================================================ */

[x-cloak] {
  display: none !important;
}

.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }

.not-found {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-weak);
}

.not-found h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-strong);
  margin-bottom: 12px;
}

.loading-wrap {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-weak);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .header-nav {
    display: none;
  }
}

@media (max-width: 900px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .post-layout {
    grid-template-columns: 1fr;
  }

  .post-layout .sidebar {
    display: none;
  }
}

@media (max-width: 600px) {
  .footer-body {
    grid-template-columns: 1fr;
  }

  .post-hero__title {
    font-size: 1.5rem;
  }

  .featured-post__title {
    font-size: 1.2rem;
  }

  .post-card__thumb,
  .post-card__thumb-placeholder {
    width: 90px;
    height: 68px;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .unlock-box {
    padding: 24px 20px;
    margin: 40px auto;
  }
}

/* ============================================================
   MOBILE DRAWER (public)
   ============================================================ */

.drawer-toggle {
  display: none;
}

@media (max-width: 768px) {
  .drawer-toggle {
    display: inline-flex;
  }
}

.pub-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 40;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.pub-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 300px;
  max-width: 85vw;
  background: var(--bg-header);
  border-left: 1px solid rgba(255,255,255,.08);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pub-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.pub-drawer__logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -.02em;
}

.pub-drawer__logo span {
  color: var(--primary);
}

.pub-drawer__close {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,.6);
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}

.pub-drawer__close:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
}

.pub-drawer__nav {
  padding: 12px 0;
  flex: 1;
}

.pub-drawer__nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}

.pub-drawer__nav a:hover,
.pub-drawer__nav a.active {
  background: rgba(255,255,255,.07);
  color: #fff;
}

.pub-drawer__divider {
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 8px 20px;
}

.pub-drawer__label {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.35);
  padding: 12px 20px 4px;
}

.pub-drawer__search {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.pub-drawer__search form {
  display: flex;
  gap: 8px;
}

.pub-drawer__search input {
  flex: 1;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: .85rem;
  padding: 7px 10px;
  outline: none;
}

.pub-drawer__search input::placeholder {
  color: rgba(255,255,255,.35);
}

.pub-drawer__search input:focus {
  border-color: var(--primary);
}

.pub-drawer__search button {
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  padding: 7px 12px;
  white-space: nowrap;
  transition: background .15s;
}

.pub-drawer__search button:hover {
  background: var(--primary-hover);
}

/* Alpine.js transition utility classes (used by pub-drawer) */
.opacity-0    { opacity: 0 !important; }
.opacity-100  { opacity: 1 !important; }
.translate-x-full { transform: translateX(100%) !important; }
.translate-x-0    { transform: translateX(0)    !important; }
.transition   { transition-property: opacity, transform; }
.ease-out     { transition-timing-function: ease-out; }
.ease-in      { transition-timing-function: ease-in; }
.duration-200 { transition-duration: 200ms; }
.duration-250 { transition-duration: 250ms; }
.duration-150 { transition-duration: 150ms; }
