/* =====================================================
   GIOTSASTECH — NEWS
   Loaded by the /news pages and by the news ticker on the homepage. News cards reuse the
   .project-grid and .project-card styles from portfolio.css.
   ===================================================== */

/* Picture size. The cover is shown in the same fixed frame whatever its own shape, cropped from the top. */
:root {
  --news-cover-max-width: 720px;
  --news-cover-ratio: 2 / 1;   /* 720 x 360 at full width */
}

.news-card__date {
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
[data-theme="light"] .news-card__date { color: #007A33; }

.news-empty {
  padding: 72px 24px;
  text-align: center;
  color: var(--text-secondary);
  border: 1px dashed var(--border-accent);
  border-radius: var(--radius-lg);
}

/* ==================
   ARTICLE
   ================== */
.article__cover {
  width: 100%;
  max-width: var(--news-cover-max-width);
  aspect-ratio: var(--news-cover-ratio);
  margin-bottom: 40px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.article__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* What the admin writes in Markdown comes out as plain tags, styled here. */
.article__body { max-width: 68ch; color: var(--text-secondary); font-size: 1.05rem; line-height: 1.85; }
.article__body > * + * { margin-top: 20px; }
.article__body h2,
.article__body h3,
.article__body h4 { color: var(--text-primary); font-weight: 400; line-height: 1.25; margin-top: 40px; }
.article__body h2 { font-size: 1.7rem; }
.article__body h3 { font-size: 1.35rem; }
.article__body h4 { font-size: 1.1rem; }
.article__body strong { color: var(--text-primary); font-weight: 600; }
.article__body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article__body a:hover { color: var(--accent-light); }
.article__body ul,
.article__body ol { padding-left: 1.4em; }
.article__body ul { list-style: disc; }
.article__body ol { list-style: decimal; }
.article__body li + li { margin-top: 8px; }
.article__body blockquote {
  padding-left: 20px;
  border-left: 2px solid var(--accent);
  color: var(--text-primary);
  font-style: italic;
}
.article__body code {
  padding: 2px 6px;
  background: var(--accent-dim);
  border-radius: var(--radius);
  font-size: 0.9em;
}
.article__body pre { padding: 16px; overflow-x: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.article__body pre code { padding: 0; background: none; }
.article__body img { max-width: 100%; height: auto; border-radius: var(--radius-lg); }
.article__body hr { border: 0; border-top: 1px solid var(--border); }
.article__body table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.article__body th,
.article__body td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.article__body th { color: var(--text-primary); font-weight: 600; }

.article__back { margin-top: 48px; }

/* ==================
   NEWS TICKER (homepage)
   A pausing up-down scroller, driven by js/ticker.js. Each line is exactly one bar high; the list slides up by
   whole lines, so --ticker-height is the only number to change.
   ================== */
.ticker {
  --ticker-height: 56px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ticker[hidden] { display: none; }

.ticker__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--ticker-height);
}

.ticker__label {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
[data-theme="light"] .ticker__label { color: #007A33; }
.ticker__label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: tickerPulse 2.4s ease-in-out infinite;
}

.ticker__viewport {
  flex: 1;
  min-width: 0;
  height: var(--ticker-height);
  overflow: hidden;
}
.ticker__list {
  transform: translateY(calc(var(--ticker-index, 0) * var(--ticker-height) * -1));
  transition: transform 0.6s var(--ease);
}
.ticker__item {
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--ticker-height);
  min-width: 0;
}
.ticker__date {
  flex-shrink: 0;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.ticker__link {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: color var(--transition);
}
.ticker__link:hover,
.ticker__link:focus-visible { color: var(--accent); }

.ticker__controls {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}
.ticker__controls[hidden] { display: none; }
.ticker__button,
.ticker__pause {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  color: var(--text-secondary);
  transition: color var(--transition), border-color var(--transition);
}
.ticker__button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 16px;
  line-height: 1;
}
.ticker__pause {
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ticker__button:hover,
.ticker__pause:hover { color: var(--accent); border-color: var(--border-accent); }

.ticker__all {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
[data-theme="light"] .ticker__all { color: #007A33; }

@keyframes tickerPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* With "reduce motion" on, headlines change without sliding or pulsing. */
@media (prefers-reduced-motion: reduce) {
  .ticker__list { transition: none; }
  .ticker__label::before { animation: none; }
}

@media (max-width: 768px) {
  .ticker { --ticker-height: 52px; }
  .ticker__inner { gap: 14px; }
  .ticker__all { display: none; }
}
@media (max-width: 480px) {
  .ticker__label,
  .ticker__date { display: none; }
}
