/* ─────────────────────────────────────────────────────────────
   tuca-articles.css  ·  Frontend cards & grid
   Prefix: .tma-
   Teme de culoare via CSS custom properties per sursă.
   ───────────────────────────────────────────────────────────── */

/* ── Tokens globali ──────────────────────────────────────────── */
:root {
  --tma-accent:        #444;
  --tma-accent-soft:   #f4f4f4;
  --tma-accent-border: #ccc;

  --tma-radius:   8px;
  --tma-radius-sm: 4px;
  --tma-shadow:   0 2px 8px rgba(0,0,0,.07);
  --tma-shadow-hover: 0 6px 20px rgba(0,0,0,.11);

  --tma-ink-900: #1a1a1a;
  --tma-ink-700: #444;
  --tma-ink-400: #888;
  --tma-ink-200: #e8e8e8;

  --tma-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ── Teme per sursă ─────────────────────────────────────────── */
.tma-source--juridice {
  --tma-accent:        #c41a1a;
  --tma-accent-soft:   #fef2f2;
  --tma-accent-border: #fca5a5;
  --tma-ink-900:       #1a1610;
}

.tma-source--uj {
  --tma-accent:        #1a3c78;
  --tma-accent-soft:   #eef2fb;
  --tma-accent-border: #a8bce8;
  --tma-ink-900:       #0d1726;
}

/* ── Defensive theme reset ────────────────────────────────────────
   Scoped la .tmal-articles-top-section.
   Previne GeneratePress și alte teme să suprascrie list markers,
   heading sizes, și display-ul elementelor noastre.
   ─────────────────────────────────────────────────────────────── */
.tmal-articles-top-section * { box-sizing: border-box; }

.tmal-articles-top-section ul,
.tmal-articles-top-section ol {
  list-style: none !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}
.tmal-articles-top-section li          { list-style: none !important; }
.tmal-articles-top-section li::marker  { content: '' !important; display: none; }

/* Override heading sizes din tema (GeneratePress face h2/h3 mari) */
.tmal-articles-top-section h2.tma-common-title {
  font-size: clamp(1.35rem, 4vw, 1.9rem) !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  margin: 0 0 .5rem !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}
.tmal-articles-top-section h3.tma-banner-row__title {
  font-size: .9375rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  color: inherit !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
.tmal-articles-top-section h3.tma-card__title {
  font-size: .975rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  color: var(--tma-ink-900) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

/* ── Section ─────────────────────────────────────────────────── */
.tma-section {
  font-family: var(--tma-font-sans);
  color: var(--tma-ink-900);
  padding: 3rem 0;
}

/* ── Header ──────────────────────────────────────────────────── */
.tma-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.tma-kicker {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--tma-accent);
  border: 1px solid var(--tma-accent-border);
  background: var(--tma-accent-soft);
  padding: .2em .8em;
  border-radius: 100px;
  margin-bottom: .75rem;
}

.tma-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--tma-ink-900);
  margin: 0 0 .5rem;
  line-height: 1.25;
}

.tma-subtitle {
  font-size: .875rem;
  color: var(--tma-ink-400);
  margin: 0;
}

/* ── Grid ────────────────────────────────────────────────────── */
.tma-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.25rem;
}

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

@media (max-width: 900px) {
  .tma-grid--col-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Card ────────────────────────────────────────────────────── */
.tma-card {
  background: #fff;
  border: 1px solid var(--tma-ink-200);
  border-radius: var(--tma-radius);
  box-shadow: var(--tma-shadow);
  transition: box-shadow .2s, transform .2s, border-color .2s;
  position: relative;
  overflow: hidden;
}

.tma-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--tma-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.tma-card:hover::before { transform: scaleX(1); }

.tma-card:hover {
  border-color: var(--tma-accent-border);
  box-shadow: var(--tma-shadow-hover);
  transform: translateY(-2px);
}

.tma-card--featured {
  border-color: var(--tma-accent-border);
  background: var(--tma-accent-soft);
}

.tma-card--featured::before { transform: scaleX(1); }

.tma-card__inner {
  padding: 1.25rem 1.375rem 1.125rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

/* ── Card top (badge + date) ──────────────────────────────────── */
.tma-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}

.tma-badge {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tma-accent);
  background: var(--tma-accent-soft);
  border: 1px solid var(--tma-accent-border);
  padding: .2em .65em;
  border-radius: 100px;
}

.tma-badge__icon {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.tma-card__date {
  font-size: .75rem;
  color: var(--tma-ink-400);
  white-space: nowrap;
}

.tma-card__divider {
  height: 1px;
  background: var(--tma-ink-200);
  margin-bottom: .875rem;
}

/* ── Card title ──────────────────────────────────────────────── */
.tma-card__title {
  font-size: .975rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 .6rem;
  flex-grow: 1;
}

.tma-card__title a {
  color: var(--tma-ink-900);
  text-decoration: none;
  transition: color .15s;
}

.tma-card__title a:hover { color: var(--tma-accent); }

/* ── Card excerpt ────────────────────────────────────────────── */
.tma-card__excerpt {
  font-size: .825rem;
  color: var(--tma-ink-700);
  line-height: 1.55;
  margin: 0 0 .875rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Card footer ─────────────────────────────────────────────── */
.tma-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
  padding-top: .75rem;
  border-top: 1px solid var(--tma-ink-200);
  margin-top: auto;
}

.tma-card__author {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  font-size: .75rem;
  color: var(--tma-ink-400);
}

.tma-card__cta {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  font-size: .75rem;
  font-weight: 600;
  color: var(--tma-accent);
  text-decoration: none;
  transition: gap .15s, opacity .15s;
}

.tma-card__cta:hover { gap: .5em; opacity: .8; }

/* ── Fallback ────────────────────────────────────────────────── */
.tma-fallback {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--tma-accent-soft);
  border: 1px solid var(--tma-accent-border);
  border-radius: var(--tma-radius);
  color: var(--tma-ink-700);
  font-size: .875rem;
  line-height: 1.55;
}

.tma-fallback svg { flex-shrink: 0; color: var(--tma-accent); margin-top: .1em; }
.tma-fallback a   { color: var(--tma-accent); }

/* ── Footer ──────────────────────────────────────────────────── */
.tma-footer { margin-top: 1.75rem; }

.tma-nota {
  font-size: .75rem;
  color: var(--tma-ink-400);
  text-align: center;
  margin: 0;
}

.tma-nota a { color: var(--tma-ink-400); }

/* ── Wrapper top-section ─────────────────────────────────────── */
.tmal-articles-top-section {
  padding: 80px 24px 20px;
  max-width: 1200px;
  margin: 0 auto;
  clear: both;
}

/* ── Common header (titlu + subtitlu unic) ───────────────────── */
.tma-common-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.tma-common-title {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--tma-ink-700, #1a202c);
  margin: 0 0 .6rem;
  line-height: 1.25;
}

.tma-common-subtitle {
  font-size: .9375rem;
  color: var(--tma-ink-400, #718096);
  margin: 0;
  line-height: 1.55;
}

/* ── Common footer ───────────────────────────────────────────── */
.tma-common-footer {
  margin-top: 2rem;
  text-align: center;
}
/* ── Banner list ──────────────────────────────────── */
.tma-banner-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tma-banner-row {
  display: grid !important;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  gap: .75rem 1.25rem;
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--tma-border, #e2e8f0);
  transition: background .15s;
}

.tma-banner-row:first-child { border-top: 1px solid var(--tma-border, #e2e8f0); }
.tma-banner-row:hover        { background: var(--tma-accent-soft, #f0f4ff); }

.tma-banner-row__meta {
  text-align: right;
}

.tma-banner-row__date {
  font-size: .75rem;
  color: #5f6368;
  white-space: nowrap;
}

.tma-banner-row__body { min-width: 0; }

.tma-banner-row__title {
  font-size: .9375rem;
  font-weight: 600;
  margin: 0 0 .2rem;
  line-height: 1.35;
}

.tma-banner-row__title a {
  color: var(--tma-ink-700, #1a202c);
  text-decoration: none;
}
.tma-banner-row__title a:hover { color: var(--tma-accent, #1d4ed8); }

.tma-banner-row__excerpt {
  font-size: .8125rem;
  color: #5f6368;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tma-banner-row__cta {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  font-size: .75rem;
  font-weight: 600;
  color: var(--tma-accent, #1d4ed8);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.tma-banner-row__cta:hover { opacity: .75; }

/* ═══════════════════════════════════════════════════════════════
   MOBILE  ·  ≤ 768 / 640 / 480px
   Toată specificitatea scoped la .tmal-articles-top-section
   + !important acolo unde tema poate să suprascrieă.
   ═══════════════════════════════════════════════════════════════ */

/* ── Wrapper padding ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .tmal-articles-top-section { padding: 40px 20px 28px !important; }
}
@media (max-width: 480px) {
  .tmal-articles-top-section { padding: 28px 16px 20px !important; }
}

/* ── Common header ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .tmal-articles-top-section .tma-common-header  { margin-bottom: 1.25rem; }
  .tmal-articles-top-section .tma-common-subtitle{ font-size: .85rem; margin-top: .35rem; }
}

/* ── Secțiune & kicker ───────────────────────────────────────── */
@media (max-width: 640px) {
  .tmal-articles-top-section .tma-section { padding: 1.5rem 0; }
  .tmal-articles-top-section .tma-header  { margin-bottom: .75rem; text-align: left; }
  .tmal-articles-top-section .tma-kicker  { margin-bottom: .5rem; font-size: .68rem; }
}

/* ── Banner rows mobile ──────────────────────────────────────── */
@media (max-width: 768px) {
  .tmal-articles-top-section .tma-banner-row {
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: .5rem .75rem;
    padding: .95rem .5rem;
    min-height: 0;
    align-items: end;
  }
  .tmal-articles-top-section .tma-banner-row__meta {
    grid-column: 1; grid-row: 2;
    text-align: left;
    margin-bottom: 0;
  }
  .tmal-articles-top-section .tma-banner-row__body {
    grid-column: 1 / -1; grid-row: 1;
    min-width: 0;
  }
  .tmal-articles-top-section .tma-banner-row__cta {
    grid-column: 2; grid-row: 2;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: auto; height: auto;
    min-height: 30px;
    padding: .35rem .7rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--tma-accent-soft);
    color: var(--tma-accent);
    font-size: .72rem !important;
    line-height: 1 !important;
    white-space: nowrap;
    transition: background .15s;
    align-self: end;
    opacity: 1;
  }
  .tmal-articles-top-section .tma-banner-row__cta svg { width: 12px !important; height: 12px !important; flex-shrink: 0; }
  .tmal-articles-top-section .tma-banner-row__cta:hover { background: var(--tma-accent-border); opacity: 1; }
  .tmal-articles-top-section .tma-banner-row__title {
    font-size: .9rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    display: block !important;
    overflow: visible !important;
  }
  .tmal-articles-top-section .tma-banner-row__excerpt { display: none !important; }
  .tmal-articles-top-section .tma-banner-row__date    { font-size: .7rem; color: #5f6368; }
}

/* ── Grid tablet → 2 col ─────────────────────────────────────── */
/* deja definit mai sus: @media (max-width: 900px) */

/* ── Grid mobile → rânduri de tip banner ────────────────────── */
@media (max-width: 640px) {

  .tmal-articles-top-section .tma-grid--col-3,
  .tmal-articles-top-section .tma-grid--col-2 {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  /* Card: flat row, fără box sau shadow */
  .tmal-articles-top-section .tma-card {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid var(--tma-ink-200) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    transition: background .15s;
  }
  .tmal-articles-top-section .tma-card:first-child {
    border-top: 1px solid var(--tma-ink-200) !important;
  }
  .tmal-articles-top-section .tma-card::before    { display: none !important; }
  .tmal-articles-top-section .tma-card:hover      { transform: none !important; box-shadow: none !important; border-color: var(--tma-ink-200) !important; }
  .tmal-articles-top-section .tma-card:active     { background: var(--tma-accent-soft) !important; }
  .tmal-articles-top-section .tma-card--featured  {
    background: var(--tma-accent-soft) !important;
    border-bottom-color: var(--tma-accent-border) !important;
  }

  /* Inner: grid [data | titlu+excerpt | →] */
  .tmal-articles-top-section .tma-card__inner {
    display: grid !important;
    grid-template-columns: 60px 1fr 44px !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    column-gap: .75rem !important;
    row-gap: .1rem !important;
    padding: .875rem .5rem !important;
    height: auto !important;
  }

  /* Col 1: dată (ambele rânduri) */
  .tmal-articles-top-section .tma-card__top {
    grid-column: 1 !important;
    grid-row: 1 / 3 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 0 !important;
    margin-bottom: 0 !important;
  }
  .tmal-articles-top-section .tma-badge      { display: none !important; }
  .tmal-articles-top-section .tma-card__date {
    font-size: .7rem !important;
    line-height: 1.4 !important;
    white-space: normal !important;
    color: var(--tma-ink-400) !important;
  }
  .tmal-articles-top-section .tma-card__divider { display: none !important; }

  /* Col 2, row 1: titlu */
  .tmal-articles-top-section .tma-card__title {
    grid-column: 2 !important;
    grid-row: 1 !important;
    font-size: .9rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    flex-grow: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
  .tmal-articles-top-section .tma-card__title a {
    color: var(--tma-ink-900) !important;
    text-decoration: none !important;
  }

  /* Col 2, row 2: excerpt 1 linie */
  .tmal-articles-top-section .tma-card__excerpt {
    grid-column: 2 !important;
    grid-row: 2 !important;
    -webkit-line-clamp: 1 !important;
    font-size: .75rem !important;
    margin: 0 !important;
    color: var(--tma-ink-400) !important;
  }

  /* Col 3: buton CTA (ambele rânduri) */
  .tmal-articles-top-section .tma-card__footer {
    grid-column: 3 !important;
    grid-row: 1 / 3 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    gap: 0 !important;
  }
  .tmal-articles-top-section .tma-card__author { display: none !important; }
  .tmal-articles-top-section .tma-card__cta {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0 !important;
    gap: 0 !important;
    width: 36px !important; height: 36px !important;
    flex-shrink: 0 !important;
    border-radius: 50% !important;
    background: var(--tma-accent-soft) !important;
    color: var(--tma-accent) !important;
    overflow: hidden !important;
    transition: background .15s;
  }
  .tmal-articles-top-section .tma-card__cta svg   { width: 12px !important; height: 12px !important; flex-shrink: 0; }
  .tmal-articles-top-section .tma-card__cta:hover { background: var(--tma-accent-border) !important; opacity: 1 !important; }
}

/* ── Common footer mobile ────────────────────────────────────── */
@media (max-width: 640px) {
  .tmal-articles-top-section .tma-common-footer { margin-top: 1.25rem; }
  .tmal-articles-top-section .tma-nota { text-align: left; font-size: .7rem; line-height: 1.5; }
}

/* ── Banner mobile hard override ───────────────────────────────
   Shortcode-urile individuale nu au wrapperul .tmal-articles-top-section,
   deci layoutul mobil trebuie sa loveasca direct clasele bannerului. */
@media (max-width: 768px) {
  .tma-banner-row {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    gap: .5rem .75rem !important;
    align-items: end !important;
    padding: .95rem .5rem !important;
    min-height: 0 !important;
  }

  .tma-banner-row__body {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
  }

  .tma-banner-row__meta {
    grid-column: 1 !important;
    grid-row: 2 !important;
    text-align: left !important;
    margin: 0 !important;
  }

  .tma-banner-row__cta {
    grid-column: 2 !important;
    grid-row: 2 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: auto !important;
    min-height: 30px !important;
    padding: .35rem .7rem !important;
    border-radius: 999px !important;
    background: var(--tma-accent-soft) !important;
    color: var(--tma-accent) !important;
    font-size: .72rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    align-self: end !important;
    opacity: 1 !important;
  }

  .tma-banner-row__cta svg {
    width: 12px !important;
    height: 12px !important;
    flex-shrink: 0 !important;
  }

  .tma-banner-row__title {
    font-size: .9rem !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    display: block !important;
    overflow: visible !important;
  }

  .tma-banner-row__excerpt {
    display: none !important;
  }

  .tma-banner-row__date {
    font-size: .7rem !important;
    color: #5f6368 !important;
    white-space: nowrap !important;
  }
}
