/* Styles for the static journal pages generated by scripts/build-articles.mjs.
   Palette and type match the storefront (tailwind.config.js: ivory, paper,
   ink, smoke, stone, field, wine). Wine marks the way to the shop. */
:root {
  --ivory: #F4EFE7;
  --paper: #FBF8F3;
  --ink: #1D1B18;
  --smoke: #5F574D;
  --stone: #D8CFC2;
  --field: #8C7F70;
  --wine: #6E2A2C;
  --wine-dark: #5A2224;
  --serif: 'Cormorant Garamond', 'Noto Serif Georgian', Georgia, serif;
  --sans: 'Inter', 'Noto Sans Georgian', system-ui, sans-serif;
}

/* Georgian script: Cormorant and Inter have no Georgian glyphs, and the
   Noto pair reads better at these sizes when it leads the stack. */
:lang(ka) {
  --serif: 'Noto Serif Georgian', 'Cormorant Garamond', serif;
  --sans: 'Noto Sans Georgian', 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 2px;
  border-radius: 4px;
}

main:focus { outline: none; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 20;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-size: 15px;
}
.skip-link:focus { top: 12px; }

/* Reading column ~68 characters; header and footer run wider. */
.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(244, 239, 231, 0.96);
  border-bottom: 1px solid var(--stone);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 8px 24px;
  min-height: 68px;
  flex-wrap: wrap;
}

.logo {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.header-nav { display: flex; gap: 20px; flex: 1; }
.header-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  font-size: 15px;
  color: var(--smoke);
}
.header-nav a:hover { color: var(--ink); }
.header-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--stone);
  text-underline-offset: 6px;
}

.lang-switch { display: flex; gap: 2px; font-size: 14px; }
.lang-switch a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--smoke);
}
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="page"] { background: var(--ink); color: #fff; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--wine);
  color: #fff !important;
  text-decoration: none !important;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
}
.button:hover { background: var(--wine-dark); }

/* Breadcrumbs */
.breadcrumbs { margin: 32px 0 4px; font-size: 14px; color: var(--smoke); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.breadcrumbs li + li::before { content: "/"; padding: 0 8px; color: var(--stone); }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; color: var(--ink); }

/* Headings */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(36px, 6vw, 56px); font-weight: 500; letter-spacing: -0.01em; margin: 8px 0 16px; }
:lang(ka) h1 { font-size: clamp(28px, 4.6vw, 42px); line-height: 1.3; }
/* Narrow phones (under 360 px): long words such as "конфиденциальности"
   must not push the page sideways. */
@media (max-width: 359px) {
  h1 { font-size: 30px; }
  :lang(ka) h1 { font-size: 26px; }
}
h1, h2, h3 { overflow-wrap: break-word; hyphens: auto; }

.lead { font-size: 20px; color: var(--smoke); max-width: 36em; margin: 0; }

/* Article */
.article-header { margin-bottom: 28px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 20px; color: var(--smoke); font-size: 15px; margin: 0; }

.article h2 {
  font-size: 32px;
  margin: 48px 0 12px;
  scroll-margin-top: 96px;
}
:lang(ka) .article h2 { font-size: 24px; line-height: 1.35; }
.article h3 { font-size: 24px; margin: 32px 0 8px; }
:lang(ka) .article h3 { font-size: 20px; }

.article p, .article li { margin: 0 0 16px; }
.article ul, .article ol { padding-left: 24px; }
.article li::marker { color: var(--smoke); }
.article strong { font-weight: 600; }
.article-body a, .sources a {
  color: var(--wine);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.article-body a:hover { text-decoration-thickness: 2px; }

.article blockquote {
  margin: 28px 0;
  padding: 18px 22px;
  background: var(--paper);
  border-left: 3px solid var(--wine);
  border-radius: 0 12px 12px 0;
}
.article blockquote p:last-child { margin-bottom: 0; }

.article table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 16px; display: block; overflow-x: auto; }
.article th, .article td { border-bottom: 1px solid var(--stone); padding: 10px 12px; text-align: left; vertical-align: top; }
.article th { font-weight: 600; background: var(--paper); }

/* Table of contents */
.toc {
  margin: 0 0 36px;
  padding: 18px 22px;
  border: 1px solid var(--stone);
  border-radius: 16px;
  background: var(--paper);
  font-size: 16px;
}
.toc-title { margin: 0 0 6px; font-weight: 600; }
.toc ol { margin: 0; padding-left: 22px; }
.toc li { margin: 4px 0; }
.toc li::marker { color: var(--smoke); }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Candles mentioned in the article */
.products {
  margin: 40px 0;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--stone);
  border-radius: 20px;
}
.products-title { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.2; margin: 0 0 14px; }
:lang(ka) .products-title { font-size: 20px; }
.products ul { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.products li { margin: 0; }
.products li a {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--stone);
  background: #fff;
  text-decoration: none;
  color: var(--ink);
}
.products li a:hover { border-color: var(--wine); }
.product-name { font-weight: 600; }
.product-note { font-size: 15px; color: var(--smoke); }

/* Read next */
.related { margin-top: 56px; }
.related h2 { font-size: 28px; margin: 0 0 12px; }
.related ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--stone); }
.related li { margin: 0; border-bottom: 1px solid var(--stone); }
.related a { display: block; padding: 16px 0; text-decoration: none; }
.related-title { display: block; font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.25; }
:lang(ka) .related-title { font-size: 18px; line-height: 1.4; }
.related-desc { display: block; margin-top: 4px; font-size: 15px; color: var(--smoke); }
.related a:hover .related-title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

.sources { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--stone); font-size: 15px; }
.sources h2 { font-size: 22px; margin: 8px 0 8px; }
.sources a { color: var(--smoke); word-break: break-word; }

/* Journal index */
.index-header { margin-bottom: 24px; }
.entries { list-style: none; padding: 0; margin: 24px 0 64px; border-top: 1px solid var(--stone); }
.entry { padding: 24px 0; border-bottom: 1px solid var(--stone); }
.entry h2 { font-size: 30px; margin: 0 0 8px; }
:lang(ka) .entry h2 { font-size: 22px; line-height: 1.35; }
.entry h2 a { text-decoration: none; }
.entry h2 a:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.entry p { margin: 0; color: var(--smoke); }
.entry .entry-meta { margin-top: 8px; font-size: 14px; }

/* Footer */
.site-footer { margin-top: 80px; border-top: 1px solid var(--stone); background: var(--paper); padding: 40px 0 48px; font-size: 15px; color: var(--smoke); }
.footer-row { display: flex; flex-wrap: wrap; gap: 32px 64px; justify-content: space-between; }
.footer-row p { margin: 6px 0; }
.footer-title { color: var(--ink); font-weight: 600; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.footer-links a, .footer-row a:not(.logo) { text-decoration: none; display: inline-flex; min-height: 32px; align-items: center; }
.footer-links a:hover, .footer-row a:not(.logo):hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.not-found-links { list-style: none; padding: 0; margin: 24px 0 64px; display: grid; gap: 8px; }
.not-found-links a { color: var(--wine); }

@media (max-width: 640px) {
  body { font-size: 17px; }
  /* Three short rows on phones: too tall to keep pinned over the text. */
  .site-header { position: static; }
  .article h2 { scroll-margin-top: 16px; }
  .header-row { padding-top: 10px; padding-bottom: 6px; gap: 4px 12px; }
  .logo { order: 1; flex: 1; }
  .button-shop { order: 2; min-height: 40px; padding: 0 16px; font-size: 14px; }
  .header-nav { order: 3; flex: 1 1 auto; gap: 16px; }
  .lang-switch { order: 4; }
  .article h2 { font-size: 27px; }
  .entry h2 { font-size: 26px; }
  .products { padding: 18px; }
}

/* Tables become stacked cards on phones (cells carry data-label, see build-articles.mjs). */
@media (max-width: 640px) {
  .article table.responsive-table { display: block; border: 0; }
  .responsive-table thead { display: none; }
  .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table tr {
    margin: 0 0 12px;
    padding: 10px 14px;
    background: var(--paper);
    border: 1px solid var(--stone);
    border-radius: 12px;
  }
  .responsive-table td { border: 0; padding: 4px 0; }
  .responsive-table td:first-child { font-weight: 600; font-size: 16px; }
  .responsive-table td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-size: 13px;
    color: var(--smoke);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Product page (scripts/product-page.mjs): photos left, details right;
   stacked on phones with the main photo first. */
.pdp {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px;
  margin: 20px 0 56px;
  align-items: start;
}
.pdp-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pdp-photo { display: block; overflow: hidden; border-radius: 14px; background: var(--stone); aspect-ratio: 1; }
.pdp-photo-main { grid-column: 1 / -1; aspect-ratio: 4 / 5; border-radius: 20px; }
.pdp-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pdp-info { position: sticky; top: 96px; }
.pdp-family { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 15px; color: var(--smoke); }
.pdp-dot { width: 12px; height: 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.pdp h1 { font-size: clamp(36px, 5vw, 52px); margin: 0; }
.pdp-kind { margin: 4px 0 0; color: var(--smoke); }
.pdp-price { display: flex; align-items: center; gap: 14px; margin: 16px 0; font-size: 24px; font-weight: 500; }
.pdp-stock { font-size: 14px; font-weight: 500; padding: 2px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--stone); }
.pdp-stock.is-out { color: var(--smoke); }
.pdp-description { margin: 0 0 20px; }
.button-buy { min-height: 52px; padding: 0 32px; font-size: 16px; }
.pdp-delivery { margin: 16px 0 0; font-size: 15px; color: var(--smoke); }
.pdp-delivery a, .pdp-guides a { color: var(--ink); text-underline-offset: 3px; }
.pdp h2 { font-size: 26px; margin: 32px 0 10px; }
.pdp-notes, .pdp-facts { margin: 0; border-top: 1px solid var(--stone); }
.pdp-notes div, .pdp-facts div { display: grid; grid-template-columns: 11em 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--stone); }
.pdp-notes dt, .pdp-facts dt { color: var(--smoke); }
.pdp-notes dd, .pdp-facts dd { margin: 0; }
.pdp-guides { margin: 28px 0 0; font-size: 15px; }
.pdp-more { margin-bottom: 64px; }

@media (max-width: 860px) {
  .pdp { grid-template-columns: 1fr; gap: 28px; }
  .pdp-info { position: static; }
  /* Keep the name and price close to the top on phones and tablets. */
  .pdp-gallery { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .pdp-photo-main { aspect-ratio: auto; height: min(62vh, 560px); }
  .pdp-notes div, .pdp-facts div { grid-template-columns: 9em 1fr; }
}

/* Customer reviews on a candle page (scripts/product-page.mjs). */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.pdp-reviews { margin: 8px 0 64px; padding-top: 40px; border-top: 1px solid var(--stone); scroll-margin-top: 96px; }
.pdp-reviews h2 { font-size: clamp(30px, 4vw, 40px); margin: 0 0 24px; }
.rv-empty { margin: 0; color: var(--smoke); }
.rv-empty a, .rv-leave a { color: var(--ink); text-underline-offset: 3px; }
.rv-layout { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 48px; align-items: start; }
.rv-summary { position: sticky; top: 96px; }
.rv-average { margin: 0; display: flex; align-items: baseline; gap: 8px; }
.rv-average-value { font-family: var(--serif); font-size: 56px; font-weight: 500; line-height: 1; }
.rv-average-of { color: var(--smoke); }
.rv-count { margin: 6px 0 18px; color: var(--smoke); font-size: 15px; }
.rv-stars { position: relative; display: inline-block; font-size: 18px; line-height: 1; letter-spacing: 2px; color: var(--stone); }
.rv-stars::before { content: '★★★★★'; }
.rv-stars-fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; white-space: nowrap; color: var(--ink); }
.rv-stars-fill::before { content: '★★★★★'; }
.rv-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rv-bars li { display: grid; grid-template-columns: 1.2em 1fr 2.5em; align-items: center; gap: 10px; font-size: 14px; color: var(--smoke); }
.rv-bar { height: 6px; border-radius: 999px; background: var(--stone); overflow: hidden; }
.rv-bar span { display: block; height: 100%; background: var(--ink); border-radius: inherit; }
.rv-bar-count { text-align: right; font-variant-numeric: tabular-nums; }
.rv-leave { margin: 20px 0 0; font-size: 15px; }
.rv-sort ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; padding: 0; }
.rv-sort a, .rv-sort span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--stone); font-size: 14px; color: var(--ink); text-decoration: none; }
.rv-sort span[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.rv-sort a:hover { border-color: var(--ink); }
.rv-list { list-style: none; margin: 0; padding: 0; }
.rv-item { padding: 22px 0; border-bottom: 1px solid var(--stone); }
.rv-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.rv-author { margin: 0; font-weight: 600; }
.rv-head time { font-size: 14px; color: var(--smoke); font-variant-numeric: tabular-nums; }
.rv-verified { margin: 6px 0 0; font-size: 13px; color: var(--smoke); }
.rv-verified::before { content: '✓ '; color: var(--ink); }
.rv-text { margin: 10px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.rv-photos { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; }
.rv-photos a { display: block; width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: var(--stone); }
.rv-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 860px) {
  .rv-layout { grid-template-columns: 1fr; gap: 28px; }
  .rv-summary { position: static; }
  .rv-average-value { font-size: 48px; }
}
