/* ============================================================
   ROOT – CSS CUSTOM PROPERTIES
   Warm Artisanal Coffee & Tea Theme
   ============================================================ */
:root {
  /* --- Colour Palette --- */
  --color-espresso:        #2C1A0E;
  --color-dark-roast:      #3D2314;
  --color-terracotta:      #C2603A;
  --color-terracotta-light:#D4785A;
  --color-terracotta-pale: #F0D5C8;
  --color-gold:            #C9A84C;
  --color-gold-light:      #E2C97E;
  --color-gold-pale:       #F5EDD4;
  --color-sage:            #7A8C6E;
  --color-sage-light:      #9EAD90;
  --color-sage-pale:       #E8EDE4;
  --color-cream:           #F7F0E6;
  --color-cream-dark:      #EDE4D6;
  --color-linen:           #FAF5EE;
  --color-text-primary:    #2C1A0E;
  --color-text-secondary:  #6B4F3A;
  --color-text-muted:      #9C7E68;
  --color-text-light:      #F7F0E6;
  --color-border:          #DDD0C0;
  --color-border-light:    #EDE4D6;
  --color-white:           #FFFFFF;

  /* --- Typography --- */
  --font-serif:   'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans:    'Lato', 'Helvetica Neue', Arial, sans-serif;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-md:   1.125rem;
  --text-lg:   1.25rem;
  --text-xl:   1.5rem;
  --text-2xl:  1.875rem;
  --text-3xl:  2.25rem;
  --text-4xl:  2.75rem;
  --text-5xl:  3.5rem;

  --leading-tight:  1.25;
  --leading-snug:   1.4;
  --leading-normal: 1.6;
  --leading-relaxed:1.75;
  --leading-loose:  1.85;

  --weight-light:   300;
  --weight-regular: 400;
  --weight-bold:    700;

  /* --- Spacing --- */
  --space-2xs: 0.25rem;
  --space-xs:  0.5rem;
  --space-sm:  0.75rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* --- Layout --- */
  --container-max:    1200px;
  --container-pad:    var(--space-lg);
  --sidebar-width:    300px;
  --gap-grid:         var(--space-xl);
  --border-radius-sm: 6px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  --border-radius-xl: 28px;

  /* --- Shadows --- */
  --shadow-xs:   0 1px 3px rgba(44, 26, 14, 0.08);
  --shadow-sm:   0 2px 8px rgba(44, 26, 14, 0.10);
  --shadow-card: 0 4px 20px rgba(44, 26, 14, 0.10);
  --shadow-hover:0 8px 32px rgba(44, 26, 14, 0.18);
  --shadow-lg:   0 12px 48px rgba(44, 26, 14, 0.16);
  --shadow-gold: 0 4px 16px rgba(201, 168, 76, 0.25);

  /* --- Gradients --- */
  --gradient-hero:      linear-gradient(160deg, var(--color-espresso) 0%, var(--color-dark-roast) 40%, var(--color-terracotta) 100%);
  --gradient-card-over: linear-gradient(to top, rgba(44, 26, 14, 0.85) 0%, rgba(44, 26, 14, 0.30) 60%, transparent 100%);
  --gradient-gold:      linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
  --gradient-cream:     linear-gradient(180deg, var(--color-linen) 0%, var(--color-cream) 100%);
  --gradient-sidebar:   linear-gradient(180deg, var(--color-cream-dark) 0%, var(--color-cream) 100%);

  /* --- Transitions --- */
  --transition-fast:   0.18s ease;
  --transition-base:   0.28s ease;
  --transition-slow:   0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* --- Texture overlay --- */
  --texture-opacity: 0.035;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  color: var(--color-text-primary);
  background-color: var(--color-linen);
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Subtle linen texture via repeating pattern */
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(44, 26, 14, var(--texture-opacity)) 2px,
      rgba(44, 26, 14, var(--texture-opacity)) 3px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 4px,
      rgba(44, 26, 14, calc(var(--texture-opacity) * 0.5)) 4px,
      rgba(44, 26, 14, calc(var(--texture-opacity) * 0.5)) 5px
    );
}

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

a {
  color: var(--color-terracotta);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-espresso);
}

p {
  margin-bottom: var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   READING PROGRESS BAR
   ============================================================ */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--gradient-gold);
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* ============================================================
   WRAPPER
   ============================================================ */
.wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  background-color: var(--color-espresso);
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(201, 168, 76, 0.03) 10px,
      rgba(201, 168, 76, 0.03) 11px
    );
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  transition: box-shadow var(--transition-base), background-color var(--transition-base);
}

.header.header--scrolled {
  box-shadow: 0 2px 24px rgba(44, 26, 14, 0.35);
}

.header__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-md) var(--container-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
}

/* Logo */
.header__logo {
  margin: 0;
  flex-shrink: 0;
}

.header__logo a {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-cream);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transition: color var(--transition-fast);
}

.header__logo a:hover {
  color: var(--color-gold-light);
}

.header__logo img {
  height: 44px;
  width: auto;
  display: inline-block;
}

/* Header Nav */
.header .nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.header .nav ul li a {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-cream);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--border-radius-sm);
  transition: background-color var(--transition-fast), color var(--transition-fast);
  position: relative;
}

.header .nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--space-md);
  right: var(--space-md);
  height: 2px;
  background: var(--color-gold);
  transform: scaleX(0);
  transition: transform var(--transition-base);
  border-radius: 1px;
}

.header .nav ul li a:hover {
  color: var(--color-gold-light);
  background-color: rgba(201, 168, 76, 0.08);
}

.header .nav ul li a:hover::after {
  transform: scaleX(1);
}

/* Toggle Button */
.header__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(247, 240, 230, 0.12);
  border: 1px solid rgba(247, 240, 230, 0.25);
  border-radius: var(--border-radius-sm);
  padding: var(--space-xs);
  cursor: pointer;
  color: var(--color-cream);
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
  flex-shrink: 0;
}

.header__toggle svg {
  stroke: var(--color-cream);
  transition: stroke var(--transition-fast);
}

.header__toggle:hover {
  background: rgba(201, 168, 76, 0.18);
  border-color: var(--color-gold);
}

.header__toggle:hover svg {
  stroke: var(--color-gold-light);
}

/* ============================================================
   TRAY (category nav below header)
   ============================================================ */
.tray {
  background-color: var(--color-dark-roast);
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
}

.tray__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.tray__inner ul {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tray__inner ul::-webkit-scrollbar {
  display: none;
}

.tray__inner ul li a {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247, 240, 230, 0.75);
  padding: var(--space-sm) var(--space-md);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.tray__inner ul li a:hover {
  color: var(--color-gold-light);
  border-bottom-color: var(--color-gold);
}

/* ============================================================
   SMALL NAV (mobile menu)
   ============================================================ */
.smallnav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background-color: var(--color-espresso);
  background-image: linear-gradient(180deg, var(--color-espresso) 0%, var(--color-dark-roast) 100%);
  z-index: 200;
  padding: var(--space-2xl) var(--space-xl);
  box-shadow: -8px 0 40px rgba(44, 26, 14, 0.5);
  overflow-y: auto;
}

.smallnav ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-xl);
}

.smallnav ul li a {
  display: block;
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  color: var(--color-cream);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid rgba(247, 240, 230, 0.1);
  transition: color var(--transition-fast), padding-left var(--transition-base);
}

.smallnav ul li a:hover {
  color: var(--color-gold-light);
  padding-left: var(--space-sm);
}

.smallnav__close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  background: rgba(247, 240, 230, 0.1);
  border: 1px solid rgba(247, 240, 230, 0.2);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.smallnav__close svg {
  stroke: var(--color-cream);
}

.smallnav__close:hover {
  background: rgba(201, 168, 76, 0.25);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main {
  flex: 1;
  padding: var(--space-2xl) 0;
}

.main__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-grid);
}

/* ============================================================
   CONTENT AREA
   ============================================================ */
.content {
  min-width: 0;
}

/* ============================================================
   SECTION HEADING
   ============================================================ */
.section-heading {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  color: var(--color-espresso);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-gold);
  display: inline-block;
}

/* ============================================================
   TOP ARTICLES (hero section)
   ============================================================ */
.top {
  background: var(--gradient-hero);
  padding: var(--space-2xl) 0;
  position: relative;
  overflow: hidden;
}

.top::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(201, 168, 76, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(194, 96, 58, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.top__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  position: relative;
  z-index: 1;
}

.top .article {
  background: rgba(247, 240, 230, 0.06);
  border: 1px solid rgba(247, 240, 230, 0.12);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.top .article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.top .article__image {
  margin: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.top .article__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.top .article:hover .article__image img {
  transform: scale(1.05);
}

.top .article__body {
  padding: var(--space-lg);
}

.top .article__title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-sm);
}

.top .article__title a {
  color: var(--color-cream);
  transition: color var(--transition-fast);
}

.top .article__title a:hover {
  color: var(--color-gold-light);
}

.top .article__perex {
  font-size: var(--text-sm);
  color: rgba(247, 240, 230, 0.75);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-sm);
}

.top .article__category a {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gold-light);
}

.top .article__category a:hover {
  color: var(--color-cream);
}

/* ============================================================
   ARTICLE CARDS (post-list)
   ============================================================ */
.articles {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.article {
  background: var(--color-white);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border-light);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  opacity: 0;
  transform: translateY(20px);
}

.article.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--transition-slow), transform var(--transition-slow), box-shadow var(--transition-base);
}

.article:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

/* Article image */
.article__image {
  margin: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background-color: var(--color-cream-dark);
  position: relative;
}

.article__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card-over);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.article:hover .article__image::after {
  opacity: 1;
}

.article__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.article:hover .article__image img {
  transform: scale(1.06);
}

/* Article body */
.article__body {
  padding: var(--space-lg) var(--space-xl);
}

/* Article title */
.article__title {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-sm);
}

.article__title a {
  color: var(--color-espresso);
  transition: color var(--transition-fast);
  display: block;
}

.article__title a:hover {
  color: var(--color-terracotta);
}

/* Article perex */
.article__perex {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Article meta */
.article__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border-light);
}

/* Article category */
.article__category {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin: 0;
}

.article__category a {
  color: var(--color-terracotta);
  padding: 2px var(--space-xs);
  background-color: var(--color-terracotta-pale);
  border-radius: var(--border-radius-sm);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.article__category a:hover {
  background-color: var(--color-terracotta);
  color: var(--color-white);
}

/* Article date */
.article__date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: var(--weight-light);
  letter-spacing: 0.04em;
  margin: 0;
}

/* ============================================================
   BOTTOM SECTION (similar / hp categories)
   ============================================================ */
.bottom {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.bottom__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.bottom .article {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border-radius: var(--border-radius-md);
}

.bottom .article__image {
  width: 120px;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  border-radius: 0;
}

.bottom .article__body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bottom .article__title {
  font-size: var(--text-base);
  margin-bottom: var(--space-xs);
}

.bottom .article__category {
  margin-bottom: var(--space-xs);
}

.bottom .article__date {
  margin-top: auto;
}

/* ============================================================
   ARTICLE TEXT (post-page / static-page)
   ============================================================ */
.text {
  background: var(--color-white);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
}

.text__title {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  color: var(--color-espresso);
  padding: var(--space-2xl) var(--space-2xl) var(--space-lg);
  background: linear-gradient(180deg, var(--color-cream) 0%, var(--color-white) 100%);
  border-bottom: 1px solid var(--color-border-light);
}

.text__cover {
  margin: 0;
  overflow: hidden;
  max-height: 480px;
}

.text__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.text__body {
  padding: var(--space-2xl);
  font-size: var(--text-md);
  line-height: var(--leading-loose);
  color: var(--color-text-primary);
}

.text__body h2 {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  color: var(--color-espresso);
  margin: var(--space-2xl) 0 var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--color-gold);
}

.text__body h3 {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  color: var(--color-dark-roast);
  margin: var(--space-xl) 0 var(--space-sm);
}

.text__body h4 {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  color: var(--color-dark-roast);
  margin: var(--space-lg) 0 var(--space-sm);
}

.text__body p {
  margin-bottom: var(--space-lg);
  color: var(--color-text-primary);
}

.text__body a {
  color: var(--color-terracotta);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(194, 96, 58, 0.4);
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.text__body a:hover {
  color: var(--color-espresso);
  text-decoration-color: var(--color-espresso);
}

.text__body ul,
.text__body ol {
  list-style: none;
  margin-bottom: var(--space-lg);
  padding-left: var(--space-lg);
}

.text__body ul li,
.text__body ol li {
  position: relative;
  margin-bottom: var(--space-sm);
  padding-left: var(--space-lg);
}

.text__body ul li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--color-gold);
  font-size: var(--text-xs);
  top: 4px;
}

.text__body ol {
  counter-reset: ol-counter;
}

.text__body ol li {
  counter-increment: ol-counter;
}

.text__body ol li::before {
  content: counter(ol-counter) '.';
  position: absolute;
  left: 0;
  color: var(--color-terracotta);
  font-weight: var(--weight-bold);
  font-family: var(--font-serif);
}

.text__body blockquote {
  border-left: 4px solid var(--color-gold);
  background: var(--color-gold-pale);
  padding: var(--space-lg) var(--space-xl);
  margin: var(--space-xl) 0;
  border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--color-dark-roast);
}

.text__body img {
  border-radius: var(--border-radius-md);
  margin: var(--space-xl) 0;
  box-shadow: var(--shadow-sm);
}

.text__body strong {
  font-weight: var(--weight-bold);
  color: var(--color-espresso);
}

.text__body em {
  font-style: italic;
  color: var(--color-text-secondary);
}

.text__body table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-xl) 0;
  font-size: var(--text-sm);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.text__body table th {
  background: var(--color-espresso);
  color: var(--color-cream);
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-serif);
  font-weight: var(--weight-bold);
  text-align: left;
}

.text__body table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text-primary);
}

.text__body table tr:nth-child(even) td {
  background: var(--color-cream);
}

.text__body table tr:hover td {
  background: var(--color-terracotta-pale);
}

/* Author image in article */
.text__body img.author {
  border-radius: 50%;
  width: 120px;
  height: 120px;
  object-fit: cover;
  float: left;
  margin: 0 var(--space-xl) var(--space-lg) 0;
  border: 3px solid var(--color-gold);
  box-shadow: var(--shadow-gold);
}

/* Text info (meta below article) */
.text__info {
  padding: var(--space-lg) var(--space-2xl);
  background: var(--color-cream);
  border-top: 1px solid var(--color-border-light);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-xl);
}

.text__date,
.text__category,
.text__author,
.text__tags {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

.text__category a,
.text__author a,
.text__tags a {
  color: var(--color-terracotta);
  font-weight: var(--weight-bold);
}

.text__category a:hover,
.text__author a:hover,
.text__tags a:hover {
  color: var(--color-espresso);
}

/* Table of contents */
.table-of-content {
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-terracotta);
  border-radius: var(--border-radius-md);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-xl);
}

.table-of-content span {
  display: block;
  font-family: var(--font-serif);
  font-weight: var(--weight-bold);
  font-size: var(--text-md);
  color: var(--color-espresso);
  margin-bottom: var(--space-sm);
}

.table-of-content a {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  display: block;
  padding: 2px 0;
  transition: color var(--transition-fast), padding-left var(--transition-fast);
}

.table-of-content a:hover {
  color: var(--color-terracotta);
  padding-left: var(--space-xs);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  background: var(--gradient-sidebar);
  border-radius: var(--border-radius-xl);
  padding: var(--space-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  height: fit-content;
}

.sidebar__heading,
.sidebar h3 {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  color: var(--color-espresso);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--color-gold);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Sidebar Nav */
.sidebar .nav ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--space-lg);
}

.sidebar .nav ul li a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius-sm);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  background: transparent;
  transition: background-color var(--transition-fast), color var(--transition-fast), padding-left var(--transition-fast);
}

.sidebar .nav ul li a:hover {
  background-color: var(--color-terracotta-pale);
  color: var(--color-terracotta);
  padding-left: var(--space-lg);
}

.sidebar .nav ul li a svg {
  stroke: var(--color-terracotta);
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

/* Sidebar articles */
.sidebar .article {
  display: flex;
  flex-direction: row;
  gap: var(--space-sm);
  align-items: flex-start;
  background: transparent;
  box-shadow: none;
  border: none;
  border-radius: 0;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: 0;
  opacity: 1;
  transform: none;
}

.sidebar .article:last-child {
  border-bottom: none;
}

.sidebar .article:hover {
  transform: none;
  box-shadow: none;
}

.sidebar .article__image {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: var(--border-radius-sm);
  aspect-ratio: 1 / 1;
}

.sidebar .article__image::after {
  display: none;
}

.sidebar .article__title {
  font-size: var(--text-sm);
  font-family: var(--font-serif);
  margin: 0;
  line-height: var(--leading-snug);
}

.sidebar .article__title a {
  color: var(--color-espresso);
}

.sidebar .article__title a:hover {
  color: var(--color-terracotta);
}

/* Sidebar tags */
.sidebar .tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.sidebar .tags li a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  background: var(--color-cream-dark);
  border: 1px solid var(--color-border);
  padding: 4px var(--space-sm);
  border-radius: 20px;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.sidebar .tags li a:hover {
  background-color: var(--color-terracotta);
  color: var(--color-white);
  border-color: var(--color-terracotta);
}

.sidebar .tags li a svg {
  stroke: currentColor;
  width: 12px;
  height: 12px;
}

/* Sidebar authors */
.sidebar .authors {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sidebar .authors li a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  padding: var(--space-xs) 0;
  transition: color var(--transition-fast);
}

.sidebar .authors li a svg {
  stroke: var(--color-sage);
  flex-shrink: 0;
}

.sidebar .authors li a:hover {
  color: var(--color-terracotta);
}

/* Sidebar promo */
.sidebar .promo {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sidebar .promo li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.sidebar .promo li svg {
  stroke: var(--color-gold);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ============================================================
   PREFOOTER (sidebar-bottom)
   ============================================================ */
.prefooter {
  background: var(--color-cream-dark);
  border-top: 1px solid var(--color-border);
  padding: var(--space-2xl) 0;
}

.prefooter__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.prefooter .sidebar__heading,
.prefooter h3 {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  color: var(--color-espresso);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--color-gold);
}

.prefooter .nav ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prefooter .nav ul li a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  border-radius: var(--border-radius-sm);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.prefooter .nav ul li a:hover {
  background-color: var(--color-terracotta-pale);
  color: var(--color-terracotta);
}

.prefooter .nav ul li a svg {
  stroke: var(--color-terracotta);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.prefooter .tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.prefooter .tags li a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-text-secondary);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  padding: 4px var(--space-sm);
  border-radius: 20px;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.prefooter .tags li a:hover {
  background-color: var(--color-terracotta);
  color: var(--color-white);
  border-color: var(--color-terracotta);
}

.prefooter .tags li a svg {
  stroke: currentColor;
  width: 12px;
  height: 12px;
}

.prefooter .authors li a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  padding: var(--space-xs) 0;
  transition: color var(--transition-fast);
}

.prefooter .authors li a svg {
  stroke: var(--color-sage);
  flex-shrink: 0;
}

.prefooter .authors li a:hover {
  color: var(--color-terracotta);
}

.prefooter .promo li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.prefooter .promo li svg {
  stroke: var(--color-gold);
  flex-shrink: 0;
  margin-top: 2px;
}

.prefooter .article {
  display: flex;
  flex-direction: row;
  gap: var(--space-sm);
  align-items: flex-start;
  background: var(--color-white);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius-md);
  padding: var(--space-sm);
  margin-bottom: var(--space-sm);
  opacity: 1;
  transform: none;
}

.prefooter .article:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.prefooter .article__image {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: var(--border-radius-sm);
  aspect-ratio: 1 / 1;
}

.prefooter .article__image::after {
  display: none;
}

.prefooter .article__title {
  font-size: var(--text-sm);
  font-family: var(--font-serif);
  margin: 0;
  line-height: var(--leading-snug);
}

.prefooter .article__title a {
  color: var(--color-espresso);
}

.prefooter .article__title a:hover {
  color: var(--color-terracotta);
}

/* ============================================================
   SEARCH FORM
   ============================================================ */
.search-form {
  margin-bottom: var(--space-xl);
}

.search-form form {
  display: flex;
  gap: var(--space-sm);
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-form form:focus-within {
  border-color: var(--color-terracotta);
  box-shadow: 0 0 0 3px rgba(194, 96, 58, 0.12);
}

.search-form input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  padding: var(--space-xs) 0;
}

.search-form input[type="text"]::placeholder {
  color: var(--color-text-muted);
}

.search-form input[type="submit"] {
  background: var(--gradient-gold);
  color: var(--color-espresso);
  border: none;
  border-radius: var(--border-radius-md);
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: opacity var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
}

.search-form input[type="submit"]:hover {
  opacity: 0.88;
  box-shadow: var(--shadow-gold);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  margin-top: var(--space-2xl);
}

.pagination ul {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.pagination ul li {
  display: flex;
}

.pagination ul li a,
.pagination ul li.pagination__active {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-sm);
  border-radius: var(--border-radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.pagination ul li a {
  background: var(--color-white);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
}

.pagination ul li a:hover {
  background: var(--color-terracotta);
  color: var(--color-white);
  border-color: var(--color-terracotta);
}

.pagination ul li.pagination__active {
  background: var(--gradient-gold);
  color: var(--color-espresso);
  border: 1px solid var(--color-gold);
  box-shadow: var(--shadow-gold);
  cursor: default;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--color-espresso);
  background-image: linear-gradient(180deg, var(--color-dark-roast) 0%, var(--color-espresso) 100%);
  color: rgba(247, 240, 230, 0.7);
  padding: var(--space-2xl) 0;
  margin-top: auto;
}

.footer__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.footer__brand {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-sm);
}

.footer__inner p {
  font-size: var(--text-sm);
  color: rgba(247, 240, 230, 0.65);
  margin: 0;
  line-height: var(--leading-normal);
}

.footer__inner a {
  color: var(--color-gold-light);
}

.footer__inner a:hover {
  color: var(--color-cream);
}

.footer__publisher {
  font-size: var(--text-xs);
  color: rgba(247, 240, 230, 0.45);
}

/* ============================================================
   POPUP
   ============================================================ */
.popup {
  display: none;
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 500;
  background: var(--color-white);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xl);
  max-width: 360px;
  width: calc(100vw - 2 * var(--space-xl));
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-terracotta);
}

.popup #close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: 1;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.popup #close:hover {
  background: var(--color-terracotta);
  color: var(--color-white);
  border-color: var(--color-terracotta);
}

/* ============================================================
   SIMILAR widget
   ============================================================ */
.similar {
  background: var(--color-terracotta-pale);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
  border: 1px solid rgba(194, 96, 58, 0.2);
}

/* ============================================================
   GLOBAL TAGS (outside sidebar)
   ============================================================ */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.tags li a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-text-secondary);
  background: var(--color-cream-dark);
  border: 1px solid var(--color-border);
  padding: 4px var(--space-sm);
  border-radius: 20px;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.tags li a:hover {
  background-color: var(--color-terracotta);
  color: var(--color-white);
  border-color: var(--color-terracotta);
}

.tags li a svg {
  stroke: currentColor;
  width: 12px;
  height: 12px;
}

/* ============================================================
   GLOBAL AUTHORS (outside sidebar)
   ============================================================ */
.authors {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.authors li a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  padding: var(--space-xs) 0;
  transition: color var(--transition-fast);
}

.authors li a svg {
  stroke: var(--color-sage);
  flex-shrink: 0;
}

.authors li a:hover {
  color: var(--color-terracotta);
}

/* ============================================================
   GLOBAL PROMO
   ============================================================ */
.promo {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.promo li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.promo li svg {
  stroke: var(--color-gold);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ============================================================
   GLOBAL NAV (generic)
   ============================================================ */
.nav ul li a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--border-radius-sm);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.nav ul li a:hover {
  background-color: var(--color-terracotta-pale);
  color: var(--color-terracotta);
}

.nav ul li a svg {
  stroke: var(--color-terracotta);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ============================================================
   RESPONSIVE – TABLET (min-width: 600px)
   ============================================================ */
@media (min-width: 600px) {
  .articles {
    grid-template-columns: repeat(2, 1fr);
  }

  .top__inner {
    grid-template-columns: repeat(2, 1fr);
  }

  .bottom__inner {
    grid-template-columns: repeat(2, 1fr);
  }

  .prefooter__inner {
    grid-template-columns: repeat(2, 1fr);
  }

  .text__title {
    font-size: var(--text-4xl);
  }
}

/* ============================================================
   RESPONSIVE – DESKTOP (min-width: 768px)
   ============================================================ */
@media (min-width: 768px) {
  :root {
    --container-pad: var(--space-xl);
  }

  .header__toggle {
    display: none;
  }

  .main__inner {
    grid-template-columns: 1fr var(--sidebar-width);
    align-items: start;
  }

  .sidebar {
    position: sticky;
    top: calc(72px + var(--space-lg));
  }

  .top__inner {
    grid-template-columns: repeat(3, 1fr);
  }

  .bottom__inner {
    grid-template-columns: repeat(3, 1fr);
  }

  .bottom .article {
    flex-direction: column;
  }

  .bottom .article__image {
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  .prefooter__inner {
    grid-template-columns: repeat(3, 1fr);
  }

  .text__title {
    font-size: var(--text-5xl);
  }

  .text__body {
    font-size: var(--text-md);
  }
}

/* ============================================================
   RESPONSIVE – LARGE DESKTOP (min-width: 1024px)
   ============================================================ */
@media (min-width: 1024px) {
  :root {
    --sidebar-width: 320px;
  }

  .articles {
    grid-template-columns: repeat(3, 1fr);
  }

  .top__inner {
    grid-template-columns: repeat(4, 1fr);
  }

  .prefooter__inner {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================================
   RESPONSIVE – MOBILE ONLY (max-width: 767px)
   ============================================================ */
@media (max-width: 767px) {
  .header__toggle {
    display: flex;
  }

  .header .nav {
    display: none;
  }

  .text__title {
    font-size: var(--text-2xl);
    padding: var(--space-lg);
  }

  .text__body {
    padding: var(--space-lg);
  }

  .text__info {
    padding: var(--space-md) var(--space-lg);
  }

  .bottom .article {
    flex-direction: row;
  }

  .bottom .article__image {
    width: 100px;
    aspect-ratio: 1 / 1;
  }

  .popup {
    bottom: var(--space-md);
    right: var(--space-md);
    left: var(--space-md);
    width: auto;
    max-width: none;
  }
}

/* ============================================================
   UTILITY
   ============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: var(--border-radius-sm);
}

/* Sklik ad containers */
#sklik_top_id,
#sklik_bottom_id,
#sklik_sidebar_id,
#sklik_article_1_id,
#sklik_article_2_id {
  display: block;
}