/* Cuenta Clara — ahorralia.digital */
:root {
  --cc-navy: #1E3A5F;
  --cc-gold: #E8A838;
  --cc-bg: #FAFAFA;
  --cc-white: #ffffff;
  --cc-text: #2c2c2c;
  --cc-muted: #6b7280;
  --cc-border: #d1d5db;
  --cc-navy-light: #2a5080;
  --cc-gold-light: #f0bc5a;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max-width: 72rem;
  --radius: 4px;
  --shadow: 0 1px 3px rgba(30, 58, 95, 0.08);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--cc-text);
  background: var(--cc-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a { color: var(--cc-navy); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--cc-gold); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--cc-navy);
  line-height: 1.25;
  margin-top: 0;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; }

ul, ol { margin: 0 0 1rem 1.25rem; }

main { flex: 1; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.text-muted { color: var(--cc-muted); }

/* Compact topbar */
.topbar {
  background: var(--cc-navy);
  color: var(--cc-white);
  font-size: 0.8rem;
  padding: 0.35rem 1rem;
  text-align: center;
}

.topbar span { opacity: 0.85; }

/* Header */
.site-header {
  background: var(--cc-white);
  border-bottom: 2px solid var(--cc-navy);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--cc-navy);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
}

.logo svg { width: 32px; height: 32px; flex-shrink: 0; }

.logo-tagline {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--cc-muted);
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  gap: 0.25rem 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.main-nav a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--cc-text);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--cc-navy);
  border-bottom-color: var(--cc-gold);
}

.nav-cat {
  font-size: 0.8rem;
  color: var(--cc-muted);
}

.nav-cat::before {
  content: "|";
  margin: 0 0.5rem;
  color: var(--cc-border);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 2px solid var(--cc-navy);
  border-radius: var(--radius);
  padding: 0.45rem 0.5rem;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--cc-navy);
}

/* Featured story */
.featured-story {
  padding: 1.5rem 1rem 0;
}

.featured-story-inner {
  display: grid;
  gap: 1.5rem;
  border: 2px solid var(--cc-navy);
  background: var(--cc-white);
  overflow: hidden;
}

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

.featured-content {
  padding: 1.25rem 1.5rem 1.5rem;
}

.featured-label {
  display: inline-block;
  background: var(--cc-gold);
  color: var(--cc-navy);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  margin-bottom: 0.75rem;
}

.featured-content h2 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  margin-bottom: 0.5rem;
}

.featured-content h2 a {
  text-decoration: none;
  color: inherit;
}

.featured-content h2 a:hover { color: var(--cc-gold); }

.featured-meta {
  font-size: 0.85rem;
  color: var(--cc-muted);
  margin-bottom: 0.75rem;
}

.intro-block {
  padding: 1.75rem 1rem;
  max-width: 48rem;
}

/* Home layout */
.home-layout {
  display: grid;
  gap: 2rem;
  padding: 0 1rem 2.5rem;
}

@media (min-width: 900px) {
  .featured-story-inner {
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
  }

  .featured-image { order: 2; }

  .home-layout {
    grid-template-columns: 1fr var(--sidebar-width, 280px);
  }
}

.magazine-section { margin-bottom: 2rem; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--cc-navy);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}

.section-header h2 { margin: 0; font-size: 1.25rem; }

.section-header a {
  font-size: 0.85rem;
  text-decoration: none;
}

/* Magazine grid — compact news cards */
.magazine-grid {
  display: grid;
  gap: 1.25rem;
}

.magazine-grid--3 {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .magazine-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .magazine-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.news-card {
  border: 1px solid var(--cc-border);
  background: var(--cc-white);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
}

.news-card:hover { box-shadow: var(--shadow); }

.news-card-thumb {
  border-bottom: 1px solid var(--cc-border);
  overflow: hidden;
}

.news-card-thumb img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.news-card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }

.news-card-cat {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cc-gold);
  margin-bottom: 0.35rem;
}

.news-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  flex: 1;
}

.news-card h3 a {
  text-decoration: none;
  color: var(--cc-navy);
}

.news-card h3 a:hover { color: var(--cc-gold); }

.news-card-excerpt {
  font-size: 0.9rem;
  color: var(--cc-muted);
  margin-bottom: 0.75rem;
}

.news-card-meta {
  font-size: 0.8rem;
  color: var(--cc-muted);
  margin: 0;
}

/* Sidebar */
.sidebar-box {
  border: 2px solid var(--cc-navy);
  background: var(--cc-white);
  padding: 1.25rem;
}

.sidebar-box h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--cc-border);
}

.picks-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.picks-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--cc-border);
}

.picks-list li:last-child { border-bottom: none; }

.picks-list a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: block;
  margin-bottom: 0.2rem;
}

.pick-date {
  font-size: 0.75rem;
  color: var(--cc-muted);
}

/* Page content */
.page-header {
  padding: 2rem 1rem 1rem;
  border-bottom: 2px solid var(--cc-navy);
  margin-bottom: 2rem;
}

.page-header h1 { margin-bottom: 0.5rem; }

.page-header .lead {
  font-size: 1.1rem;
  color: var(--cc-muted);
  max-width: 42rem;
}

.page-content {
  max-width: 42rem;
  padding: 0 1rem 3rem;
  margin: 0 auto;
}

.page-content--wide {
  max-width: var(--max-width);
}

/* Article */
.article-header {
  padding: 2rem 1rem 1.5rem;
  max-width: 42rem;
  margin: 0 auto;
}

.article-cat {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cc-gold);
  letter-spacing: 0.04em;
}

.article-header h1 { margin: 0.5rem 0; }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--cc-muted);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cc-border);
}

.author-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-block img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--cc-navy);
}

.article-hero {
  max-width: var(--max-width);
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.article-hero img {
  width: 100%;
  border: 2px solid var(--cc-navy);
}

.article-body {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.article-body h2 {
  font-size: 1.35rem;
  margin-top: 2rem;
}

.updated-note {
  font-size: 0.85rem;
  color: var(--cc-muted);
  font-style: italic;
}

.related-articles {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  border-top: 2px solid var(--cc-navy);
}

.related-articles h2 {
  font-size: 1.15rem;
  margin-bottom: 1.25rem;
}

.related-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

.related-card {
  border: 1px solid var(--cc-border);
  padding: 1rem;
  background: var(--cc-white);
}

.related-card h3 { font-size: 1rem; margin: 0; }
.related-card h3 a { text-decoration: none; }

/* Contact */
.contact-box {
  border: 2px solid var(--cc-navy);
  background: var(--cc-white);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.contact-box p:last-child { margin-bottom: 0; }

/* Footer */
.site-footer {
  background: var(--cc-navy);
  color: var(--cc-white);
  padding: 2rem 1rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.footer-tagline {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-bottom: 1.25rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  margin-bottom: 1.25rem;
}

.footer-nav a {
  color: var(--cc-white);
  text-decoration: none;
  font-size: 0.85rem;
  opacity: 0.9;
}

.footer-nav a:hover { color: var(--cc-gold); opacity: 1; }

.footer-bottom {
  font-size: 0.8rem;
  opacity: 0.7;
  margin: 0;
}

/* Cookie notice */
.cookie-notice {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--cc-white);
  border-top: 2px solid var(--cc-navy);
  padding: 1rem;
  z-index: 200;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -4px 12px rgba(30, 58, 95, 0.12);
}

.cookie-notice.is-visible { transform: translateY(0); }

.cookie-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-inner p {
  margin: 0;
  font-size: 0.85rem;
  flex: 1;
  min-width: 200px;
}

.cookie-accept {
  background: var(--cc-navy);
  color: var(--cc-white);
  border: none;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}

.cookie-accept:hover { background: var(--cc-navy-light); }

/* Mobile */
@media (max-width: 768px) {
  .menu-toggle { display: flex; }

  .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-top: 1px solid var(--cc-border);
  }

  .main-nav.is-open { display: flex; }

  .nav-cat::before { display: none; }
}
