/* Articles section (generated pages under /articles and /en/articles) */
.article-page { padding-bottom: 80px; }
.article-lead { text-align: center; max-width: 640px; margin: -20px auto 36px; color: #555; }
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.article-empty { grid-column: 1 / -1; text-align: center; padding: 48px 0; color: #666; }
.article-card { display: flex; flex-direction: column; background: var(--card-bg); border-radius: var(--border-radius); box-shadow: var(--box-shadow); overflow: hidden; color: var(--text-color); transition: var(--transition); }
.article-card:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12); }
.article-card img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: #0b3d33; }
.article-card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.article-card-body time, .article-meta { font-size: 0.85rem; color: #777; }
.article-card-body h2 { font-size: 1.15rem; line-height: 1.45; color: var(--primary-color); }
.article-card-body p { font-size: 0.95rem; color: #555; }
.article-more { margin-top: auto; font-weight: 600; color: var(--primary-color); }
/* Article page: reading column + sticky rates column */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.article-body { min-width: 0; padding: 36px 44px 40px; }
.article-body h1 { color: var(--primary-color); font-size: 2rem; line-height: 1.4; margin: 14px 0 12px; }
.article-text { max-width: 68ch; }
.article-text h2 { margin-top: 34px; }
.article-text h3 { color: var(--primary-color); margin: 24px 0 8px; font-size: 1.2rem; }
.article-text p, .article-text li { font-size: 1.06rem; line-height: 1.9; }
.article-text p { margin-bottom: 16px; }
.article-text a { color: var(--primary-color); text-decoration: underline; }
.article-back { display: inline-block; font-size: 0.92rem; font-weight: 600; color: var(--primary-color); }
.article-back:hover { text-decoration: underline; }
.article-topline { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; padding-bottom: 16px; border-bottom: 1px solid rgba(0, 0, 0, 0.08); }
.about-content .article-meta { display: flex; align-items: center; gap: 8px; margin: 0; }
.article-hero { width: 100%; height: auto; border-radius: var(--border-radius); margin: 24px 0 28px; display: block; }
.article-cta { margin-top: 28px; padding: 24px; border-radius: var(--border-radius); background: rgba(0, 77, 64, 0.06); text-align: center; }
.about-content .article-cta p { margin-bottom: 14px; font-weight: 600; }
.article-btn { display: inline-block; background: var(--secondary-color); color: var(--dark-text) !important; text-decoration: none !important; font-weight: 700; padding: 10px 28px; border-radius: 30px; }

/* Reading progress (sits on the bottom edge of the fixed header) */
.read-progress { position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 1001; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: var(--secondary-color); transform: scaleX(0); transform-origin: left; }

/* Share buttons */
.share-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; position: relative; }
.share-label { font-size: 0.85rem; font-weight: 600; color: #666; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(0, 0, 0, 0.12); background: #fff; color: #444; font-size: 1rem; cursor: pointer; transition: var(--transition); text-decoration: none; }
.share-btn[hidden] { display: none; }
.share-btn:hover, .share-btn:focus-visible { color: #fff; transform: translateY(-2px); border-color: transparent; background: var(--primary-color); }
.share-btn:focus-visible { outline: 2px solid var(--secondary-color); outline-offset: 2px; }
.share-facebook:hover, .share-facebook:focus-visible { background: #1877f2; }
.share-whatsapp:hover, .share-whatsapp:focus-visible { background: #1faa53; }
.share-x:hover, .share-x:focus-visible { background: #000; }
.share-linkedin:hover, .share-linkedin:focus-visible { background: #0a66c2; }
.share-telegram:hover, .share-telegram:focus-visible { background: #229ed9; }
.share-copy.copied { background: #15803d; border-color: transparent; color: #fff; }
.share-copy.copied i::before { content: "\f00c"; }
.share-status { font-size: 0.82rem; font-weight: 600; color: #15803d; }
.share-status:empty { display: none; }
.share-top .share-status { position: absolute; right: 0; top: calc(100% + 4px); background: #fff; padding: 2px 8px; border-radius: 6px; box-shadow: var(--box-shadow); white-space: nowrap; z-index: 2; }
.share-end { margin-top: 36px; padding-top: 22px; border-top: 1px solid rgba(0, 0, 0, 0.08); justify-content: space-between; }
.share-end .share-label { font-size: 1rem; color: var(--text-color); }

/* Rates column */
.article-aside { position: sticky; top: min(100px, calc(100vh - var(--aside-h, 0px) - 90px)); min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.aside-card { background: var(--card-bg); border-radius: 12px; box-shadow: var(--box-shadow); padding: 18px 20px; }
.aside-card h2 { font-size: 1.05rem; color: var(--primary-color); margin: 0 0 12px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.tag-chip { display: inline-block; padding: 5px 14px; border-radius: 50px; font-size: 0.85rem; font-weight: 600; color: var(--primary-color); background: rgba(0, 77, 64, 0.07); border: 1px solid rgba(0, 77, 64, 0.14); text-decoration: none; transition: var(--transition); }
.tag-chip:hover, .tag-chip:focus-visible, .tag-chip.active { background: var(--primary-color); color: #fff; }
.tag-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: -12px 0 28px; }
.tag-filter[hidden] { display: none; }
.article-card[hidden] { display: none; }
.recent-list { list-style: none; padding: 0; margin: 0; }
.recent-list li + li { border-top: 1px solid rgba(0, 0, 0, 0.07); }
.recent-list a { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--text-color); text-decoration: none; }
.recent-list li:first-child a { padding-top: 0; }
.recent-list li:last-child a { padding-bottom: 0; }
.recent-list img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.recent-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.recent-title { font-size: 0.9rem; font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recent-list a:hover .recent-title { color: var(--primary-color); text-decoration: underline; }
.recent-list time { font-size: 0.74rem; color: #777; }
.rates-card { background: var(--card-bg); border-radius: 12px; box-shadow: var(--box-shadow); border: 1px solid rgba(255, 193, 7, 0.4); padding: 20px 20px 8px; }
.rates-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.rates-head h2 { font-size: 1.1rem; color: var(--primary-color); margin: 0; }
.rates-date { font-size: 0.76rem; color: #777; white-space: nowrap; }
.rate-block { padding: 16px 0 12px; }
.rate-block + .rate-block { border-top: 1px solid rgba(0, 0, 0, 0.08); }
.rate-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rate-name { display: flex; flex-direction: column; gap: 2px; }
.rate-label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.95rem; }
.rate-source { font-size: 0.72rem; color: #777; padding-left: 16px; }
.rate-figure { text-align: right; white-space: nowrap; }
.rate-value { font-size: 1.45rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rate-value.gold-val { color: #8a6508; }
.rate-value.silver-val { color: #2f5f93; }
.rate-figure .live-unit { color: #666; }
.rate-trend { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 6px; font-size: 0.76rem; color: #666; }
.rate-block .chart-wrap { height: 130px; }
.rate-block .chart-wrap svg { touch-action: pan-y; }

@media (max-width: 1023px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-aside { position: static; }
  .article-text { max-width: none; }
  .rate-blocks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
  .rate-block + .rate-block { border-top: 0; }
  .article-page { padding-bottom: 110px; }
}
@media (max-width: 640px) {
  .article-body { padding: 22px 18px 26px; }
  .article-body h1 { font-size: 1.5rem; }
  .rate-blocks { grid-template-columns: 1fr; }
  .rate-block + .rate-block { border-top: 1px solid rgba(0, 0, 0, 0.08); }
  .share-btn { width: 44px; height: 44px; }
  .share-end { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .share-btn { transition: none; }
  .share-btn:hover { transform: none; }
}

/* ==========================================================================
   Articles index (redesign): hero, topic rail + search, featured card, grid,
   compact list cards on phones, show-more, CTA band.
   ========================================================================== */
.article-index { --idx-radius: 16px; --idx-line: rgba(0, 0, 0, 0.07); --gold-ink: #7a5800; }
.article-index { padding-top: 112px; }

/* Hero */
.idx-hero { text-align: center; max-width: 680px; margin: 0 auto 28px; }
.idx-eyebrow { display: inline-block; margin: 0 0 12px; padding: 4px 14px; border-radius: 50px; background: rgba(255, 193, 7, 0.18); color: var(--gold-ink); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; }
.idx-title { font-size: clamp(2rem, 4.2vw, 2.8rem); line-height: 1.25; color: var(--primary-color); margin: 0 0 10px; }
.article-index .article-lead { margin: 0 auto; font-size: 1.05rem; line-height: 1.7; }

/* Search + topics */
.idx-tools { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 8px; }
.idx-tools[hidden] { display: none; }
.idx-search { position: relative; width: 100%; max-width: 560px; }
.idx-search > i { position: absolute; inset-inline-start: 18px; top: 50%; transform: translateY(-50%); color: #888; pointer-events: none; }
.idx-search input { width: 100%; height: 52px; padding: 0 76px 0 48px; font: inherit; font-size: 1rem; color: var(--text-color); background: #fff; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 50px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); appearance: none; -webkit-appearance: none; transition: var(--transition); }
.idx-search input::placeholder { color: #6f6f6f; opacity: 1; }
.idx-search input::-webkit-search-cancel-button { display: none; }
.idx-search input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(0, 77, 64, 0.16); }
.idx-clear { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); height: 36px; padding: 0 14px; border: 0; border-radius: 50px; background: rgba(0, 77, 64, 0.08); color: var(--primary-color); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.idx-clear[hidden] { display: none; }

.article-index .tag-filter { display: block; width: 100%; margin: 0; }
.topic-rail { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.topic-panel { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; padding: 16px; background: #fff; border: 1px solid var(--idx-line); border-radius: var(--idx-radius); }
.topic-panel[hidden] { display: none; }
.article-index .tag-chip { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 16px; background: #fff; border: 1px solid rgba(0, 77, 64, 0.2); white-space: nowrap; }
.article-index .tag-chip:hover { background: rgba(0, 77, 64, 0.08); color: var(--primary-color); }
.article-index .tag-chip.active, .article-index .tag-chip.active:hover { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.article-index .tag-chip:focus-visible, .topic-more:focus-visible, .idx-more-btn:focus-visible, .idx-clear:focus-visible, .idx-reset:focus-visible { outline: 2px solid var(--secondary-color); outline-offset: 2px; }
.chip-count { margin-inline-start: 8px; padding: 1px 7px; border-radius: 50px; background: rgba(0, 77, 64, 0.1); font-size: 0.72rem; font-weight: 700; }
.tag-chip.active .chip-count { background: rgba(255, 255, 255, 0.22); }
.topic-more { min-height: 40px; padding: 6px 16px; border: 1px dashed rgba(0, 77, 64, 0.45); border-radius: 50px; background: transparent; color: var(--primary-color); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.topic-more:hover { background: rgba(0, 77, 64, 0.06); }

.idx-status { margin: 18px 0 16px; font-size: 0.88rem; color: #666; text-align: center; min-height: 1.4em; }

/* Grid */
.article-index .article-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.article-index .article-card { position: relative; border-radius: var(--idx-radius); border: 1px solid var(--idx-line); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); }
.article-index .article-card:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(0, 0, 0, 0.1); color: var(--text-color); }
.article-index .article-card:focus-visible { outline: 3px solid var(--secondary-color); outline-offset: 2px; }
.card-media { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: #0b3d33; }
/* The post art carries its own headline and logo in the bottom quarter; the page prints the real title, so the image is drawn 132% tall and the box clips that quarter off. */
.article-index .article-card img { width: 100%; height: 132%; aspect-ratio: auto; object-fit: cover; object-position: top center; display: block; transition: transform 0.5s ease; }
.article-index .article-card:hover img { transform: scale(1.04); }
.card-badge { position: absolute; top: 12px; inset-inline-start: 12px; padding: 4px 12px; border-radius: 50px; background: var(--secondary-color); color: #1f1700; font-size: 0.78rem; font-weight: 800; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }
.article-index .article-card-body { padding: 18px 20px 20px; gap: 10px; }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 0.8rem; }
.card-kicker { padding: 2px 10px; border-radius: 50px; background: rgba(0, 77, 64, 0.08); color: var(--primary-color); font-weight: 700; }
.article-index .article-card-body time { font-size: 0.8rem; color: #6b6b6b; }
.article-index .article-card-body h2 { font-size: 1.12rem; line-height: 1.5; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; transition: color 0.2s; }
.article-index .article-card:hover h2 { color: #00695c; text-decoration: underline; text-underline-offset: 3px; }
.article-index .article-card-body p { font-size: 0.93rem; line-height: 1.7; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.article-index .article-more { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; font-size: 0.9rem; }
.article-more i { font-size: 0.8rem; transition: transform 0.2s; }
.article-card:hover .article-more i { transform: translateX(4px); }

/* Featured (latest) article: wide card, only while no filter/search is active */
.article-index .article-grid:not(.is-filtered) .is-featured { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.article-index .is-featured .card-media { aspect-ratio: auto; min-height: 340px; }
.article-index .is-featured .article-card-body { justify-content: center; gap: 14px; padding: 36px 40px; }
.article-index .is-featured h2 { font-size: 1.7rem; line-height: 1.4; -webkit-line-clamp: 4; }
.article-index .is-featured .article-card-body p { font-size: 1.02rem; -webkit-line-clamp: 4; }
.article-index .is-featured .article-more { margin-top: 6px; padding: 10px 22px; align-self: flex-start; border-radius: 50px; background: var(--primary-color); color: #fff; }
.article-index .is-featured:hover .article-more { background: #00695c; }

/* Empty, more, CTA */
.article-index .idx-empty { padding: 56px 0 24px; font-size: 1.05rem; }
.article-index .idx-empty[hidden], .idx-more[hidden] { display: none; }
.idx-reset { display: block; margin: 14px auto 0; padding: 10px 22px; border: 0; border-radius: 50px; background: var(--primary-color); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.idx-more { display: flex; justify-content: center; margin-top: 32px; }
.idx-more-btn { min-height: 52px; padding: 0 36px; border: 2px solid var(--primary-color); border-radius: 50px; background: #fff; color: var(--primary-color); font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; transition: var(--transition); }
.idx-more-btn:hover { background: var(--primary-color); color: #fff; }
.idx-cta { display: flex; align-items: center; justify-content: space-between; gap: 20px 32px; margin-top: 56px; padding: 32px 40px; background: var(--primary-color); color: #fff; text-align: left; border-radius: 20px; }
.about-content .idx-cta p, .idx-cta p { margin: 0; font-size: 1.25rem; font-weight: 700; line-height: 1.6; }
.idx-cta .article-btn { flex-shrink: 0; padding: 14px 32px; font-size: 1rem; }

@media (pointer: coarse) { .article-index .tag-chip, .topic-more { min-height: 44px; } }

/* Tablet */
@media (max-width: 1023px) {
  .article-index { padding-top: 104px; }
  .article-index .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .article-index .is-featured .card-media { min-height: 280px; }
  .article-index .is-featured .article-card-body { padding: 26px 28px; }
  .article-index .is-featured h2 { font-size: 1.4rem; }
}

/* Phone: one scannable column of compact cards, one big card on top, swipeable topic rail */
@media (max-width: 767px) {
  .article-index .article-grid:not(.is-filtered) .is-featured { display: flex; }
  .article-index .is-featured .card-media { min-height: 0; aspect-ratio: 4 / 3; }
  .article-index .is-featured .article-card-body { padding: 18px 18px 20px; gap: 10px; justify-content: flex-start; }
  .article-index .is-featured h2 { font-size: 1.3rem; }
  .article-index .is-featured .article-card-body p { font-size: 0.95rem; -webkit-line-clamp: 3; }
}
@media (max-width: 640px) {
  .article-index { padding-top: 92px; }
  .idx-hero { margin-bottom: 20px; }
  .idx-title { font-size: 1.9rem; }
  .article-index .article-lead { font-size: 0.98rem; }
  .idx-tools { gap: 12px; }
  .idx-search input { height: 50px; font-size: 16px; } /* 16px stops iOS zooming on focus */
  .article-index .tag-filter { align-self: stretch; width: auto; margin-inline: -20px; }
  .topic-rail { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 2px 20px 6px; scroll-snap-type: x proximity; scroll-padding-inline: 20px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .topic-rail::-webkit-scrollbar { display: none; }
  /* fade the right edge so the clipped chip reads as "more this way" */
  .topic-rail { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); padding-inline-end: 44px; }
  .topic-rail > * { flex: 0 0 auto; scroll-snap-align: start; }
  .article-index .tag-chip, .topic-more { min-height: 44px; }
  .topic-panel { margin: 10px 20px 0; justify-content: flex-start; }
  .idx-status { margin: 12px 0 14px; text-align: left; }

  .article-index .article-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .article-index .article-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: stretch; border-radius: 14px; }
  .article-index .article-card:hover { transform: none; }
  .article-index .article-card .card-media { aspect-ratio: 1 / 1; align-self: start; margin: 12px 0 12px 12px; border-radius: 10px; }
  .article-index .article-card:hover .card-media img { transform: none; }
  .article-index .article-card-body { padding: 12px 14px 12px 12px; gap: 6px; }
  .article-index .article-card-body h2 { font-size: 1rem; line-height: 1.5; }
  .article-index .article-card-body p { font-size: 0.86rem; line-height: 1.6; -webkit-line-clamp: 2; }
  .article-index .article-card .article-more { display: none; }
  .card-kicker { padding: 1px 8px; font-size: 0.74rem; }
  .card-badge { top: 8px; inset-inline-start: 8px; padding: 2px 9px; font-size: 0.7rem; }

  /* Featured keeps the full-width image-on-top layout */
  .article-index .article-grid:not(.is-filtered) .is-featured { display: flex; flex-direction: column; }
  .article-index .is-featured .card-media { margin: 0; border-radius: 0; aspect-ratio: 4 / 3; }
  .article-index .is-featured .article-more { display: inline-flex; width: 100%; justify-content: center; padding: 12px 22px; }
  .article-index .is-featured .card-badge { top: 12px; inset-inline-start: 12px; padding: 4px 12px; font-size: 0.78rem; }

  .idx-more-btn { width: 100%; }
  .idx-cta { flex-direction: column; align-items: stretch; text-align: center; padding: 26px 22px; margin-top: 40px; border-radius: 18px; }
  .about-content .idx-cta p, .idx-cta p { font-size: 1.1rem; }
  .idx-cta .article-btn { text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .article-index .article-card, .article-index .article-card img, .article-more i { transition: none; }
  .article-index .article-card:hover, .article-index .article-card:hover img, .article-card:hover .article-more i { transform: none; }
}

/* Cards held back by paging/filtering must stay out of the layout whatever display the breakpoint gives them */
.article-index .article-card[hidden] { display: none !important; }
