/*
Theme Name: WebSalad RealMagazine
Theme URI: https://websalad.example
Author: WebSalad
Description: Template WordPress che trasforma homepage e articoli in un vero quotidiano cartaceo, stile seppia/vintage con testata blackletter. La homepage si estende automaticamente in base alle categorie presenti nel sito.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: wsrm
*/

* { box-sizing: border-box; }

body.wsrm {
  margin: 0;
  background: oklch(90% 0.015 80);
  font-family: 'PT Serif', Georgia, serif;
  color: oklch(18% 0.02 55);
}

a { color: inherit; }

.wsrm-page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: clamp(8px, 3vw, 32px) 0;
}

.wsrm-wrap {
  width: 100%;
  max-width: 1180px;
  background: oklch(95% 0.018 85);
  box-shadow: 0 2px 24px oklch(30% 0.02 60 / 0.25);
  padding: clamp(16px, 3vw, 40px) clamp(14px, 4vw, 48px) clamp(30px, 4vw, 56px);
}

/* MASTHEAD */
.wsrm-topbar {
  display: flex;
  justify-content: space-between;
  font-size: clamp(10px, 1.4vw, 13px);
  letter-spacing: 0.04em;
  padding: 4px 2px 10px;
  border-bottom: 1px solid oklch(18% 0.02 55 / 0.4);
  margin-bottom: 10px;
  gap: 8px;
  flex-wrap: wrap;
}

.wsrm-masthead {
  text-align: center;
  border-bottom: 4px double oklch(18% 0.02 55);
  padding-bottom: 10px;
  margin-bottom: 6px;
}

.wsrm-masthead h1 {
  font-family: 'UnifrakturMaguntia', serif;
  font-weight: 400;
  font-size: clamp(34px, 7vw, 76px);
  margin: 4px 0 6px;
  letter-spacing: 0.01em;
}

.wsrm-masthead h1 a { text-decoration: none; color: inherit; }

.wsrm-tagline {
  font-size: clamp(10px, 1.3vw, 13px);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: oklch(30% 0.02 55);
}

/* NAV */
.wsrm-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(10px, 2vw, 26px);
  padding: 10px 0;
  border-bottom: 3px solid oklch(18% 0.02 55);
  margin-bottom: clamp(16px, 3vw, 28px);
  font-family: 'Old Standard TT', serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: clamp(11px, 1.5vw, 14px);
  list-style: none;
  padding-left: 0;
}

.wsrm-nav a {
  text-decoration: none;
  color: oklch(18% 0.02 55);
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}

.wsrm-nav a:hover,
.wsrm-nav .current-cat a {
  color: oklch(35% 0.13 30);
  border-bottom-color: oklch(35% 0.13 30);
}

/* KICKER */
.wsrm-kicker {
  font-family: 'Old Standard TT', serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: clamp(11px, 1.4vw, 13px);
  color: oklch(35% 0.13 30);
  margin-bottom: 6px;
  text-decoration: none;
  display: inline-block;
}

/* HERO + SIDEBAR ROW */
.wsrm-hero-row {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(18px, 3vw, 36px);
  padding-bottom: clamp(18px, 3vw, 32px);
  border-bottom: 1px solid oklch(18% 0.02 55 / 0.35);
}

.wsrm-hero { flex: 3 1 460px; }

.wsrm-hero h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(30px, 4.8vw, 54px);
  line-height: 1.04;
  margin: 0 0 10px;
}

.wsrm-hero h2 a { text-decoration: none; color: inherit; }
.wsrm-hero h2 a:hover { text-decoration: underline; }

.wsrm-dek {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(15px, 2vw, 19px);
  line-height: 1.4;
  margin: 0 0 14px;
  color: oklch(28% 0.02 55);
}

.wsrm-media {
  width: 100%;
  aspect-ratio: 16/9;
  background: repeating-linear-gradient(45deg, oklch(70% 0.02 80), oklch(70% 0.02 80) 10px, oklch(75% 0.02 82) 10px, oklch(75% 0.02 82) 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-size: 12px;
  color: oklch(35% 0.02 60);
  margin-bottom: 8px;
  border: 1px solid oklch(18% 0.02 55 / 0.4);
  overflow: hidden;
}

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

.wsrm-caption {
  font-size: 12px;
  font-style: italic;
  color: oklch(38% 0.02 55);
  margin-bottom: 14px;
}

.wsrm-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: clamp(12px, 1.5vw, 14px);
  font-family: 'Old Standard TT', serif;
  border-top: 1px solid oklch(18% 0.02 55 / 0.4);
  padding-top: 8px;
}

/* SIDEBAR */
.wsrm-sidebar {
  flex: 1 1 240px;
  border-left: 3px double oklch(18% 0.02 55);
  padding-left: clamp(14px, 2vw, 22px);
}

.wsrm-sidebar-title {
  font-family: 'UnifrakturMaguntia', serif;
  font-size: clamp(20px, 2.4vw, 26px);
  margin-bottom: 12px;
  text-align: center;
}

.wsrm-sidebar-item {
  padding: 10px 0;
  border-top: 1px solid oklch(18% 0.02 55 / 0.3);
}

.wsrm-sidebar-item .wsrm-kicker { font-size: 10px; margin-bottom: 3px; }

.wsrm-sidebar-item a {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(14px, 1.8vw, 16px);
  line-height: 1.25;
  text-decoration: none;
  color: inherit;
}

.wsrm-sidebar-item a:hover { text-decoration: underline; }

/* CARD ROWS (medium articles + per-category sections) */
.wsrm-row {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(18px, 3vw, 32px);
  padding-top: clamp(18px, 3vw, 28px);
}

.wsrm-card {
  flex: 1 1 280px;
  border-left: 3px double oklch(18% 0.02 55);
  padding-left: clamp(14px, 2vw, 20px);
}

.wsrm-card h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(19px, 2.4vw, 24px);
  line-height: 1.12;
  margin: 0 0 8px;
}

.wsrm-card h3 a { text-decoration: none; color: inherit; }
.wsrm-card h3 a:hover { text-decoration: underline; }

.wsrm-card .wsrm-media { aspect-ratio: 4/3; font-size: 10px; }

.wsrm-card p {
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 8px;
  color: oklch(24% 0.02 55);
}

.wsrm-card .wsrm-byline {
  font-size: 11px;
  font-family: 'Old Standard TT', serif;
  color: oklch(38% 0.02 55);
}

/* DYNAMIC CATEGORY SECTIONS */
.wsrm-category-section {
  padding-top: clamp(20px, 3vw, 32px);
  margin-top: clamp(20px, 3vw, 32px);
  border-top: 3px double oklch(18% 0.02 55);
}

.wsrm-category-section h2.wsrm-rubrica-title {
  font-family: 'UnifrakturMaguntia', serif;
  font-size: clamp(24px, 3vw, 32px);
  text-align: center;
  margin: 0 0 6px;
}

.wsrm-category-section .wsrm-rubrica-sub {
  text-align: center;
  font-family: 'Old Standard TT', serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: oklch(35% 0.02 55);
  margin-bottom: 4px;
}

/* SINGLE ARTICLE */
.wsrm-article-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 20px;
}

.wsrm-article-header h1 {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(32px, 5vw, 50px);
  line-height: 1.05;
  margin: 0 0 12px;
}

.wsrm-article-meta {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  font-family: 'Old Standard TT', serif;
  border-top: 1px solid oklch(18% 0.02 55 / 0.4);
  border-bottom: 1px solid oklch(18% 0.02 55 / 0.4);
  padding: 8px 0;
}

.wsrm-article-media {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 6px;
  aspect-ratio: 21/9;
}

.wsrm-article-caption {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 28px;
  font-size: 12px;
  font-style: italic;
  color: oklch(38% 0.02 55);
}

.wsrm-article-body {
  columns: 280px;
  column-gap: clamp(20px, 3vw, 40px);
  column-rule: 1px solid oklch(18% 0.02 55 / 0.35);
  max-width: 1080px;
  margin: 0 auto;
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.62;
  text-align: left;
}

.wsrm-article-body p { margin: 0 0 14px; break-inside: avoid-column; }

.wsrm-article-body > p:first-of-type::first-letter {
  float: left;
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 74px;
  line-height: 0.78;
  padding: 4px 8px 0 0;
}

.wsrm-pagination {
  max-width: 900px;
  margin: 28px auto 0;
  border-top: 3px solid oklch(18% 0.02 55);
  padding-top: 14px;
  font-family: 'Old Standard TT', serif;
  font-size: 13px;
  text-align: center;
  font-style: italic;
  color: oklch(30% 0.02 55);
}

.wsrm-pagination a {
  text-decoration: none;
  color: oklch(35% 0.13 30);
  margin: 0 6px;
}

.wsrm-pagination a:hover { text-decoration: underline; }

/* ARCHIVE / CATEGORY GRID */
.wsrm-archive-title {
  font-family: 'UnifrakturMaguntia', serif;
  font-size: clamp(28px, 4vw, 40px);
  text-align: center;
  margin: 0 0 24px;
}

.wsrm-archive-grid {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(18px, 3vw, 32px);
}

.wsrm-wp-pagination {
  margin-top: clamp(24px, 4vw, 40px);
  text-align: center;
  font-family: 'Old Standard TT', serif;
  font-size: 13px;
  border-top: 1px solid oklch(18% 0.02 55 / 0.4);
  padding-top: 14px;
}

.wsrm-wp-pagination a,
.wsrm-wp-pagination span {
  display: inline-block;
  margin: 0 4px;
  text-decoration: none;
  color: oklch(18% 0.02 55);
}

.wsrm-wp-pagination a:hover { color: oklch(35% 0.13 30); }
.wsrm-wp-pagination .current { font-weight: 700; color: oklch(35% 0.13 30); }

/* FOOTER */
.wsrm-footer {
  margin-top: clamp(24px, 4vw, 44px);
  border-top: 4px double oklch(18% 0.02 55);
  padding-top: 12px;
  text-align: center;
  font-family: 'Old Standard TT', serif;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: oklch(30% 0.02 55);
}

::selection { background: oklch(40% 0.05 60); color: oklch(96% 0.02 85); }
