/* Explicit site navigation link class to avoid Bootstrap overrides */
.site-nav-link { color: #ffffff !important; }
.site-nav-link:focus, .site-nav-link:hover { color: #ffffff !important; text-decoration: underline !important; outline: 3px solid rgba(255,255,255,0.14) !important; outline-offset: 2px !important; }
/* Tag badge: custom class so we don't depend on Bootstrap text-primary/bg-light */
.tag-badge { background: #e9f6ff; color: #041f3a; border: 1px solid rgba(7,55,99,0.08); text-decoration: none; padding: 0.18em 0.7em; border-radius: 0.375rem; display: inline-block; }
.tag-badge:focus, .tag-badge:hover { color: #041f3a; text-decoration: none; box-shadow: 0 0 0 3px rgba(4,31,58,0.06); }
/* Shared styles for notizie.fun webapp */
body { background: linear-gradient(135deg, #eaf2ff 0%, #ffffff 100%); font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; color: #212529; font-size-adjust: 0.52; }
.navbar { box-shadow: 0 2px 8px rgba(0,0,0,0.04); position: sticky; top: 0; z-index: 100; background: #08366a !important; }
.hero { display: contents; /* deprecated: no longer used on homepage; keep non-empty to satisfy linters */ }
.page-title { color: #0d6efd; font-weight: 700; }

/* Homepage cards */
.news-card { margin-bottom: 1.5rem; border-radius: 1.2rem; border: none; box-shadow: 0 2px 12px rgba(13,110,253,0.07); position: relative; }
.news-title { font-size: 1.18rem; font-weight: 600; color: #0d6efd; }
.news-meta { color: #6c757d; font-size: 0.95rem; }
.news-excerpt { color: #5a6268; }
.news-source { color: #6c757d; font-style: italic; }
.sep { color: #adb5bd; }
/* Grid-based card layout (desktop & default) */
.news-card-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "date  date"
    "thumb right";
  gap: 0.75rem 1rem;
  align-items: start;
  justify-items: start;
}
.news-row-date { grid-area: date; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.news-row-main-thumb { grid-area: thumb; justify-self: start; }
.news-right { grid-area: right; display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.thumb-wrap { width: 120px; aspect-ratio: 1 / 1; border-radius: .5rem; overflow: hidden; background: #eef3ff; display: block; flex: 0 0 auto; text-decoration: none; }
.thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-date-badge { background: #e7f1ff; color: #073763; font-size: 0.85rem; border-radius: 0.5rem; padding: 0.18em 0.7em; margin-bottom: 0.5em; display: inline-block; }
/* Generative badge */
/* removed .badge-generative styles (feature deprecated) */
/* Responsive thumbnail sizes */
@media (min-width: 576px) { /* sm */
  .thumb-wrap { width: 136px; }
}
@media (min-width: 768px) { /* md */
  .thumb-wrap { width: 160px; }
}
@media (min-width: 1200px) { /* xl+ */
  .thumb-wrap { width: 176px; }
}

/* Mobile portrait reflow: image full-width between date and title with 16:9 */
@media (max-width: 575.98px) and (orientation: portrait) {
  .news-card-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "date"
      "thumb"
      "right";
  }
  .news-row-main-thumb .thumb-wrap { width: 100%; aspect-ratio: 16 / 9; }
}

/* Article page */
.container-article { max-width: 860px; }
.container-content { max-width: 860px; }
.article h1 { font-weight: 700; font-size: 2rem; }
.article .meta { color: #6c757d; font-size: 0.95rem; margin-bottom: 1rem; }
.article .content { font-size: 1.05rem; line-height: 1.65; }
.article .content img { max-width: 100%; height: auto; }
.breadcrumbs { font-size: .9rem; margin: .75rem 0 1rem; }
.breadcrumbs a { text-decoration: none; }
.related { margin-top: 2rem; }
.related h2 { font-size: 1.1rem; }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; }
.post-nav a { text-decoration: none; }

/* Comments */
#commentsSection h2 { font-size: 1.25rem; }
#commentsList .fw-semibold { color: #0d6efd; }
#commentsList .small { color: #6c757d; }

/* Constrain card reading width and improve card readability */
.news-card .flex-grow-1 { max-width: 720px; }
.news-card .card-body { line-height: 1.55; }


/* Footer (light) */
footer { background: #f8f9fa; color: #495057; padding: 2rem 0 1rem 0; margin-top: 3rem; }
footer a { color: #0b63b8; text-decoration: none; }
footer a:hover, footer a:focus { color: #084a82; text-decoration: underline; outline: 3px solid rgba(11,99,184,0.12); outline-offset: 2px; }
.site-footer-link { color: #0b63b8 !important; }

/* Font performance tweaks: using system fonts to avoid webfont-induced CLS. */

/* Force light theme also in dark-mode environments for consistent branding */
@media (prefers-color-scheme: dark) {
  body { background: linear-gradient(135deg, #eaf2ff 0%, #ffffff 100%); color: #212529; }
}
.news-title a { text-decoration: none; }
.news-title a:focus { outline: 3px solid rgba(13,110,253,.3); outline-offset: 2px; border-radius: .25rem; }

/* (removed) RSS icon styles: no longer used */

/* Brand logo icon (bullhorn) */
.navbar .logo-svg svg { color: #fff; filter: drop-shadow(0 1px 0 rgba(0,0,0,0.1)); }

/* RSS icon CSS not needed (inline SVG used) */

/* Improve contrast for tags that use bg-light + text-primary combination */
.badge.bg-light.text-primary { background: #e9f6ff; color: #073763; border: 1px solid rgba(7,55,99,0.08); }
.badge.bg-light.text-primary:focus, .badge.bg-light.text-primary:hover { color: #041f3a; text-decoration: none; }

/* Stronger overrides for navbar links to beat Bootstrap .navbar-dark rules loaded after inline styles */
.navbar.navbar-dark .nav-link,
.navbar-dark .nav-link { color: #ffffff !important; }
.navbar.navbar-dark .nav-link.text-white-50,
.navbar-dark .nav-link.text-white-50 { color: #ffffff !important; opacity: 1 !important; }
.navbar.navbar-dark .nav-link:focus,
.navbar.navbar-dark .nav-link:hover,
.navbar-dark .nav-link:focus,
.navbar-dark .nav-link:hover { color: #ffffff !important; text-decoration: underline !important; outline: 3px solid rgba(255,255,255,0.12) !important; outline-offset: 2px !important; }

/* Ensure tag badges when used as links meet contrast requirements */
a.badge.bg-light.text-primary { background: #e9f6ff !important; color: #041f3a !important; border: 1px solid rgba(7,55,99,0.08) !important; }
a.badge.bg-light.text-primary:focus, a.badge.bg-light.text-primary:hover { color: #041f3a !important; text-decoration: none !important; box-shadow: 0 0 0 3px rgba(4,31,58,0.08) !important; }

/* Smooth image loading animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.article-hero img,
.content img {
  animation: fadeIn 0.6s ease-out;
}

/* Smooth transitions for interactive elements */
.news-card,
.card,
.btn,
a {
  transition: all 0.2s ease;
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(13,110,253,0.12);
}

/* Enhanced focus states for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(13,110,253,0.5);
  outline-offset: 2px;
}
