/* ============================================================
   CSS CUSTOM PROPERTIES — UNTRR Design System
   Ported from html/css/main.css: design tokens + reset + base
   elements + .container/.sr-only utilities, plus the handful of
   classes reused across every post listing site-wide (badges,
   category colors, article title/excerpt, meta row, section
   heading) — genuinely global, unlike page-specific layout, which
   gets its own file as each page is converted (see front-page.css).
   ============================================================ */

:root {
  /* ── Brand colors ── */
  --red:            #ed1f23;
  --red-light:      #fde9e9;
  --blue-light:     #e6edff;
  --burgundy:       #8a1538;
  --yellow:         #ffb800;
  --green:          #3eb750;
  --blue:           #1a73e8;

  /* ── Neutral palette ── */
  --bg:             #f9f8f6;
  --surface:        #ffffff;
  --grey:           #e7e8e8;
  --grey-meta:      #9d9d9c;
  --text:           #001520;

  /* ── Typography ── */
  --font-heading:   'Archivo Narrow', sans-serif;
  --font-body:      'Open Sans', sans-serif;

  /* ── Letter-spacing: Photoshop -30 tracking → CSS ── */
  --ls-30:          -0.03em;
  --ls-25:          -0.025em;

  /* ── Layout ── */
  --container:      1440px;
  --container-pad:  clamp(16px, 3vw, 48px);

  /* ── Transitions ── */
  --transition:     0.2s ease;
}

/* ── Dark mode overrides ── */
[data-theme="dark"] {
  --bg:             #0d1117;
  --surface:        #161b22;
  --grey:           #21262d;
  --grey-meta:      #6e7681;
  --text:           #e6edf3;
  --red-light:      #1f0608;
  --blue-light:     #0d1a35;
}
/* ============================================================
   CSS RESET & BASE
   ============================================================ */

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

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color var(--transition), color var(--transition);
}

img, svg, video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--transition);
}

a:not(.featured-card):not(.btn-secondary-nav):not(.btn-primary-nav):not(.cta-btn):not(.site-logo):not(.footer-logo):not(.ad-slide):not(.play-btn):hover {
  opacity: 0.75;
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

/* ── Utility: container ── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ── Utility: visually hidden ── */
.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;
}

/* ============================================================
   Shared post-listing primitives — used by any component that
   renders a post teaser (hero, archive cards, carousels, ...)
   ============================================================ */

.section-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(28px, 3vw, 48px);
  letter-spacing: var(--ls-30);
  line-height: 1.3;
  color: var(--text);
  text-transform: uppercase;
  margin-bottom: 24px;
}

.meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.meta-time {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: var(--ls-25);
  color: var(--grey-meta);
  line-height: 1.3;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: var(--ls-25);
  text-transform: uppercase;
  line-height: 1.3;
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
}

/* HOT badge — filled red */
.badge-hot {
  background-color: var(--red);
  color: #fff;
}

/* Category badge — outlined, color varies via inline --cat-color */
.badge-cat {
  background-color: transparent;
  border: 1.5px solid var(--cat-color, var(--blue));
  color: var(--cat-color, var(--blue));
}

/* Category color helpers */
.cat-reprezentare { --cat-color: var(--red); }
.cat-tir          { --cat-color: #891537; }
.cat-legislatie   { --cat-color: var(--blue); }
.cat-info-utile    { --cat-color: var(--green); }
.cat-stiri-video  { --cat-color: var(--yellow); }

/* Premium badge — absolute positioned over images */
.badge-premium {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: var(--ls-25);
  text-transform: uppercase;
  background-color: var(--red);
  color: #fff;
  padding: 3px 8px;
  border-radius: 3px;
  line-height: 1.3;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-premium::before {
  content: '';
  display: inline-block;
  width: 11px;
  height: 11px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M5 16L3 5l5.5 5L12 2l3.5 8L21 5l-2 11H5zm0 2h14v2H5v-2z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

/* When badge-premium appears inline (meta-row), reset absolute positioning */
.meta-row .badge-premium {
  position: static;
}

/* ── CTA button (shared primitive — used by the Reprezentare sidebar CTA
   and every "Cont — …" form's submit button, e.g. cont.css's .cont-form) ── */
.cta-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background-color: var(--red);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(13px, 1.2vw, 18px);
  letter-spacing: var(--ls-30);
  text-transform: uppercase;
  padding: 10px 20px;
  border-radius: 6px;
  transition: opacity var(--transition);
}

.cta-btn:hover {
  opacity: 0.88;
}

.cta-btn-arrow {
  font-size: 1.3em;
  line-height: 1;
}

/* ── Article title / excerpt ── */
.article-title {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: var(--ls-30);
  color: var(--text);
  transition: color var(--transition);
}

.article-title:hover {
  opacity: 0.7;
}

.article-excerpt {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Article teaser primitives (hot-article list / featured-card+sub-articles
   pair) — used by the homepage hero (front-page.css adds the hero's own
   3-column grid + column-reorder-at-720px on top) and the Abonament page's
   "Articole Premium" section (abonament.css). Kept here, not duplicated in
   either page-specific file, since a third page reusing this teaser layout
   shouldn't need to re-copy it again — see .cta-btn just above for the same
   reasoning (that one had gone missing entirely; these had only gone missing
   from every page except the homepage). ── */
.hot-topic-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hot-article {
  padding: 20px 0;
  border-bottom: 1px solid var(--grey);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hot-article:first-child {
  padding-top: 0;
}

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

.hot-article .article-title {
  font-size: clamp(18px, 1.8vw, 26px);
}

.hot-article .article-excerpt {
  -webkit-line-clamp: 2;
}

.featured-card {
  background-color: var(--red-light);
  border: 2px solid var(--red);
  border-radius: 10px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  margin-bottom: 24px;
  text-decoration: none;
  transition: box-shadow var(--transition);
}

.featured-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.featured-card .article-title {
  font-size: clamp(18px, 1.8vw, 26px);
}

.featured-card .article-excerpt {
  -webkit-line-clamp: 3;
  color: var(--text);
  opacity: 0.75;
}

.featured-card-image {
  width: clamp(120px, 14vw, 200px);
  flex-shrink: 0;
  align-self: start;
}

.featured-card-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.sub-articles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.sub-article {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 4px;
}

.sub-article .article-title {
  font-size: clamp(18px, 1.2vw, 18px);
  -webkit-line-clamp: 4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 720px) {
  .sub-articles {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .featured-card {
    grid-template-columns: 1fr;
  }

  .featured-card-image {
    width: 100%;
  }

  .featured-card-image img {
    height: 200px;
  }
}

/* ── Carousel (noutati) primitives — used by the homepage Legislație/Știri
   Video carousels (front-page.css layers its own .stirivideo-section
   overrides on top), post.html's Articole Similare, and search.html's
   Articole Recomandate. Kept here, not duplicated per page, same reasoning
   as the article teaser primitives just above (and .cta-btn further up) —
   see [[feedback_html_css_class_mismatches]] in memory. makeCarousel() in
   assets/js/main.js drives whichever #id a given .noutati-track/-prev/-next
   trio uses; the CSS itself doesn't care what the ids are. ── */
.noutati-section {
  padding: 28px 0 24px;
  background-color: var(--bg);
  border-top: 1px solid var(--grey);
}

.noutati-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.noutati-header .section-heading {
  margin-bottom: 0;
}

.carousel-arrows {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.carousel-arrow {
  width: 36px;
  height: 36px;
  border: 2px solid var(--text);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity var(--transition);
  flex-shrink: 0;
}

.carousel-arrow:hover {
  opacity: 0.5;
}

.noutati-viewport {
  overflow: hidden;
}

.noutati-track {
  display: flex;
  gap: 24px;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.noutati-card {
  flex: 0 0 calc(25% - 18px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.noutati-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  margin-bottom: 10px;
}

.noutati-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.noutati-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.noutati-card .article-title {
  font-size: clamp(18px, 1.8vw, 28px);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.noutati-card .article-excerpt {
  -webkit-line-clamp: 3;
}

.noutati-divider {
  margin-top: 40px;
  border: none;
  border-top: 1px solid var(--grey);
}

@media (max-width: 1024px) {
  .noutati-card {
    flex: 0 0 calc(50% - 12px);
  }
}

@media (max-width: 600px) {
  .noutati-card {
    flex: 0 0 calc(100% - 0px);
  }
}

/* ── Featured card (horizontal) — used by the homepage's Reprezentare
   section (category_news.php/category_column.php) and search.html's
   result list (search.php); archive.html's listing will need it too.
   Page-specific files only add overrides on top (e.g. archive.css's
   `.archive-featured-list .cat-featured`), the base rule lives here so a
   third page reusing this card doesn't have to re-copy it — same
   reasoning as the carousel primitives just above; see
   [[feedback_html_css_class_mismatches]] in memory. ── */
.cat-featured {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--grey);
}

.cat-featured-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-featured-body .article-title {
  font-size: clamp(20px, 2vw, 32px);
}

.cat-featured-body .article-excerpt {
  -webkit-line-clamp: 6;
  font-size: 15px;
  color: var(--text);
  opacity: 0.8;
}

.cat-featured-image {
  width: clamp(200px, 22vw, 340px);
  flex-shrink: 0;
}

.cat-featured-image img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

@media (max-width: 720px) {
  .cat-featured {
    grid-template-columns: 1fr;
  }

  .cat-featured-image {
    width: 100%;
  }

  .cat-featured-image img {
    height: 200px;
  }
}

/* ── Play button overlay — used by the homepage's Știri Video carousel
   (video_news.php, `.video-card-image`) and search.html's video result
   card (`.archive-img-wrap`); works over either since it's just
   `position: absolute` inside a `position: relative` parent, not tied to
   either card's own layout. ── */
.play-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background-color: #ffb800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.play-btn svg {
  margin-left: 3px;
}

/* ── CTA box ("Creează un cont") — used by the homepage's Reprezentare
   section (category_news.php's sidebar) and archive.php's sidebar; both are
   the same red-bordered box next to a listing, just in a narrower column on
   archive.php. Page-specific files only add layout overrides on top (e.g.
   front-page.css's `.categorie-section > .container` grid collapse), the
   base rule + its two responsive reflows live here so a third page reusing
   this box doesn't have to re-copy it — same reasoning as the primitives
   above; see [[feedback_html_css_class_mismatches]] in memory. ── */
.categorie-cta {
  background-color: var(--red-light);
  border: 2px solid var(--red);
  border-radius: 10px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cta-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(28px, 2.5vw, 40px);
  letter-spacing: var(--ls-30);
  line-height: 1.2;
  color: var(--red);
  text-transform: uppercase;
}

.cta-body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  flex: 1;
}

/* .cta-btn/.cta-btn-arrow themselves live further up in this file. */

@media (max-width: 1100px) {
  .categorie-cta {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
  }

  .cta-heading { flex: 0 0 100%; }
  .cta-body    { flex: 1; }
  .cta-btn     { flex-shrink: 0; }
}

@media (max-width: 720px) {
  .categorie-cta {
    flex-direction: column;
  }
}

/* ── Tag pill primitives — the outlined pill used by trend_topics.php
   ("Subiecte în Trend"), partner_names.php's Site-uri Partenere list
   (`.trend-tags` wrapper + `.siteuri-tag`, styled identically to
   `.trend-tag` — see below), and archive.php's own subcategory tabs
   (`.archive-tags` wrapper, `.trend-tag` items). `html/css/main.css` (the
   static prototype) keeps these here too, not in a page-specific file —
   this theme's port had them stuck in `front-page.css` until archive.php
   needed them as well; see [[feedback_html_css_class_mismatches]] in
   memory. ── */
.trend-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trend-tag {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(14px, 1.2vw, 20px);
  letter-spacing: var(--ls-25);
  color: var(--text);
  border: 2px solid var(--text);
  border-radius: 4px;
  padding: 8px 18px;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition), background-color var(--transition);
}

[data-theme="dark"] .trend-tag {
  border-color: var(--grey-meta);
  color: var(--text);
}

/* ── Promo Banner — hero_ads( array( 'wide' => true ) ), used by both
   front-page.php and archive.php. ── */
.promo-banner-section {
  padding: 28px 0;
  background-color: var(--bg);
}

.promo-banner {
  display: block;
  border-radius: 12px;
  overflow: hidden;
}

.promo-banner img {
  display: block;
  width: 100%;
  height: 265px;
  object-fit: cover;
  object-position: center center;
}

@media (max-width: 720px) {
  /* A fixed height this short next to a column this narrow crops in far
     tighter than on desktop (665px wide ÷ 265px tall is already a ~5:1
     banner; a 360px phone at the same 265px would be under 1.4:1 — most of
     the image's width gets cropped away instead of just its height),
     likely cutting off text/logos meant to read across the full banner.
     Shortening it here keeps roughly the same wide-banner proportions
     instead of zooming in. */
  .promo-banner img {
    height: 85px;
  }
}

/* ── "Recomandările noastre" / Info utile — category_showcase(), used by
   both front-page.php and archive.php. ── */
.infotari-section {
  padding: 28px 0;
  background-color: var(--bg);
  border-top: 1px solid var(--grey);
}

.infotari-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.infotari-header .section-heading {
  margin-bottom: 0;
  flex-shrink: 0;
}

.country-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.country-tab {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(13px, 1.1vw, 18px);
  letter-spacing: var(--ls-25);
  text-transform: uppercase;
  color: var(--green);
  border: 2px solid var(--green);
  border-radius: 4px;
  padding: 7px 16px;
  white-space: nowrap;
  transition: background-color var(--transition), color var(--transition);
}

.country-tab:hover,
.country-tab.active {
  background-color: var(--green);
  color: #fff;
  opacity: 1;
}

.infotari-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.infotari-featured {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.infotari-featured-image {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.infotari-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.infotari-featured .article-title {
  font-size: clamp(20px, 1.8vw, 30px);
  display: block;
  margin-top: 6px;
}

.infotari-featured .article-excerpt {
  -webkit-line-clamp: 3;
  margin-top: 8px;
}

.infotari-col {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.infotari-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--grey);
}

.infotari-card:first-child {
  padding-top: 0;
}

.infotari-card:last-child {
  border-bottom: none;
}

.infotari-card-flag {
  width: 110px;
  aspect-ratio: 4/3;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.infotari-card-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.infotari-card:hover .infotari-card-flag img {
  transform: scale(1.06);
}

.infotari-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.infotari-card .article-title {
  font-size: clamp(18px, 1.1vw, 18px);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 1100px) {
  .infotari-grid {
    grid-template-columns: 1fr 1fr;
  }

  .infotari-featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }

  .infotari-featured-image {
    aspect-ratio: 16/10;
  }
}

@media (max-width: 680px) {
  .infotari-grid {
    grid-template-columns: 1fr;
  }

  .infotari-featured {
    grid-column: 1;
    display: flex;
  }

  .infotari-card {
    grid-template-columns: 80px 1fr;
  }

  .infotari-card-flag {
    width: 80px;
  }
}

/* ── Site-uri Partenere — partner_names(), used by both front-page.php and
   archive.php. Wrapper is `.trend-tags` above; `.siteuri-tag` is visually
   identical to `.trend-tag` but kept as its own class (matching the
   prototype) since a partner link and a subcategory tab aren't the same
   kind of thing even though they look alike. ── */
.siteuripartenere-section {
  padding: 24px 0 28px;
  background-color: var(--bg);
  border-top: 1px solid var(--grey);
}

.siteuri-tag {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(14px, 1.2vw, 20px);
  letter-spacing: var(--ls-25);
  color: var(--text);
  border: 2px solid var(--text);
  border-radius: 4px;
  padding: 8px 18px;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition), background-color var(--transition);
}

[data-theme="dark"] .siteuri-tag {
  border-color: var(--grey-meta);
}
