/* ============================================
   CATSUP.IO — Static Site Stylesheet
   ============================================ */

/* ---- Variables ---- */
:root {
  --c-red: #C41E1E;
  --c-red-dark: #8B1A1A;
  --c-rust: #D44A2C;
  --c-cream: #F7F2E8;
  --c-cream-light: #FDF6EE;
  --c-brown-dark: #2A1A0A;
  --c-brown-deep: #3A2A1A;
  --c-brown-mid: #5C4A30;
  --c-brown-soft: #6B5A40;
  --c-tan: #8B6B4A;
  --c-tan-light: #B8A890;
  --c-border: #E2D9C8;
  --c-border-dark: #3D2E1E;
  --c-white: #FFFFFF;
  --c-text: #3A2A1A;
  --c-text-light: #6B5A40;

  --font-display: 'Source Serif 4', serif;
  --font-body: 'Source Serif 4', serif;
  --font-hand: 'Caveat', cursive;

  --max-width: 1200px;
  --content-width: 720px;
  --radius: 10px;
  --radius-sm: 8px;
  --radius-pill: 20px;
  --transition: 0.2s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--c-cream);
  color: var(--c-text);
  line-height: 1.7;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-red); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--c-red-dark); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.25;
  color: var(--c-brown-dark);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p { margin-bottom: 1.25rem; }
p:last-child { margin-bottom: 0; }

/* ---- Layout ---- */
.site-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.content-narrow {
  max-width: var(--content-width);
  margin: 0 auto;
}

/* ---- Header ---- */
.site-header {
  background: var(--c-red);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}

.site-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 6px;
}

.site-brand__icon-img {
  width: 50px;
  height: 50px;
  display: block;
  border-radius: 4px;
}

.site-brand__name {
  color: var(--c-cream);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  font-family: 'Newsreader', serif;
  text-transform: uppercase;
  line-height: 1;
}

/* ---- Navigation ---- */
.main-nav > ul {
  list-style: none;
  display: flex;
  gap: 24px;
}

.main-nav a {
  color: var(--c-cream);
  font-size: 12px;
  letter-spacing: 1px;
  opacity: 0.9;
  transition: opacity var(--transition);
  text-transform: capitalize;
}

.main-nav a:hover,
.main-nav .current > a {
  opacity: 1;
  border-bottom: 1.5px solid var(--c-cream);
  padding-bottom: 2px;
}

.main-nav > ul > li {
  position: relative;
}

.main-nav > ul > li > a {
  padding-top: 20px;
  padding-bottom: 20px;
}

.sub-menu {
  display: none !important;
  position: absolute;
  /* controlled via aria-expanded below */
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--c-brown-dark);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 8px 0;
  box-shadow: 0 15px 40px rgba(0,0,0,0.4);
  z-index: 1000;
  flex-direction: column;
  gap: 0;
  list-style: none;
}

/* Submenú visible solo cuando aria-expanded="true" */
.has-children > a[aria-expanded="true"] + .sub-menu {
  display: flex !important;
}

.sub-menu li { width: 100%; }

.sub-menu__all {
  color: var(--c-cream) !important;
  font-weight: 600 !important;
  border-bottom: 1px solid rgba(255,255,255,0.1) !important;
  margin-bottom: 4px;
  padding-bottom: 10px !important;
}

.sub-menu a {
  display: block;
  padding: 7px 16px;
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.5px;
  text-transform: none;
  white-space: nowrap;
  border-bottom: none !important;
  opacity: 1 !important;
  transition: background 0.15s, color 0.15s;
}

.sub-menu a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  padding-bottom: 7px !important;
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--c-cream);
  margin: 4px 0;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--c-red-dark) 0%, var(--c-red) 40%, var(--c-rust) 100%);
  padding: 56px 0;
  position: relative;
  overflow: hidden;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.hero__label {
  font-size: 11px;
  letter-spacing: 3px;
  color: #F7C2A0;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.hero__title {
  font-size: 2.25rem;
  color: var(--c-cream);
  margin-bottom: 14px;
  max-width: 540px;
}

.hero__desc {
  font-size: 15px;
  color: #F0BFA8;
  max-width: 440px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--c-cream);
  color: var(--c-red-dark);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 24px;
  letter-spacing: 0.5px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.hero__cta:hover {
  transform: translateY(-1px);
  color: var(--c-red-dark);
}

/* ---- Section Headers ---- */
.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.section-label__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-red);
  flex-shrink: 0;
}

.section-label__dot--rust { background: var(--c-rust); }
.section-label__dot--tan  { background: var(--c-tan); }

.section-label__text {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--c-tan);
  font-weight: 500;
  text-transform: uppercase;
}

/* ---- Post List ---- */
.post-list-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  align-items: flex-start;
}

.post-list-item__thumb {
  min-width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-red-dark);
  flex-shrink: 0;
}

.post-list-item__thumb img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.post-list-item__content { flex: 1; }

.post-list-item__header {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 5px;
}

.post-list-item__date {
  font-size: 11px;
  color: var(--c-tan-light);
}

.post-list-item__title {
  font-size: 15px;
  font-weight: 500;
  color: var(--c-brown-dark);
  margin-bottom: 5px;
  line-height: 1.35;
}

.post-list-item__title a { color: inherit; }
.post-list-item__title a:hover { color: var(--c-red); }

.post-list-item__excerpt {
  font-size: 12px;
  color: var(--c-text-light);
  line-height: 1.5;
}

/* ---- Category Badge ---- */
.card__category {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
  display: inline-block;
}

.cat-news    { background: #FAE8D0; color: #854F0B; }
.cat-culture { background: #D6E0E8; color: #4A5A6B; }
.cat-history { background: #FAE8D0; color: #854F0B; }

/* ---- Stat Cards ---- */
.stat-card {
  text-align: center;
  padding: 16px 8px;
  background: var(--c-white);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
}

.stat-card__number {
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--c-red);
}

.stat-card__label {
  font-size: 11px;
  color: var(--c-tan);
  margin-top: 4px;
}

/* ---- Grids ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }

/* ---- Post content ---- */
.post-content {
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.7;
  color: var(--c-text-light);
}

/* ---- Footer ---- */
.site-footer {
  background: var(--c-brown-dark);
}

.footer-newsletter {
  padding: 24px;
  border-bottom: 1px solid var(--c-border-dark);
  display: flex;
  gap: 16px;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-newsletter__text { flex: 1; }

.footer-newsletter__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--c-cream);
  font-family: var(--font-body);
}

.footer-newsletter__desc {
  font-size: 12px;
  color: #8B7A60;
  margin-top: 4px;
}

.footer-newsletter__form {
  display: flex;
  gap: 8px;
}

.footer-newsletter__input {
  background: var(--c-border-dark);
  border: 1px solid #4D3E2E;
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 12px;
  color: var(--c-cream);
  min-width: 200px;
  font-family: var(--font-body);
}

.footer-newsletter__input::placeholder { color: var(--c-brown-soft); }
.footer-newsletter__input:focus { outline: none; border-color: var(--c-red); }

.footer-newsletter__submit {
  background: var(--c-red);
  color: var(--c-cream);
  font-size: 12px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  white-space: nowrap;
  transition: background var(--transition);
}

.footer-newsletter__submit:hover { background: var(--c-red-dark); }

.footer-columns {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 20px;
  border-bottom: 1px solid var(--c-border-dark);
}

.footer-brand__link {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  margin-bottom: 14px;
}

.footer-brand__name {
  color: var(--c-cream);
  font-size: 22px;
  font-weight: 800;
  font-family: 'Newsreader', serif;
  text-transform: uppercase;
}

.footer-brand__desc {
  font-size: 12px;
  color: var(--c-brown-soft);
  line-height: 1.6;
  margin-bottom: 14px;
  max-width: 200px;
}

.footer-social {
  display: flex;
  gap: 8px;
}

.footer-social__link {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--c-border-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  cursor: pointer;
}

.footer-social__link:hover { background: var(--c-brown-mid); }
.footer-social__link svg { fill: #8B7A60; }

.footer-col__title {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #8B7A60;
  font-weight: 500;
  margin-bottom: 12px;
  text-transform: uppercase;
  font-family: var(--font-body);
}

.footer-col__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col__list a {
  font-size: 13px;
  color: var(--c-tan-light);
  transition: color var(--transition);
}

.footer-col__list a:hover { color: var(--c-cream); }

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom__text {
  font-size: 11px;
  color: var(--c-brown-mid);
}

/* ---- Animations ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeInUp 0.5s ease both; }
.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }

/* ─── Back to top ─── */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 9000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-red);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s, background 0.2s;
  pointer-events: none;
}
.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--c-red-dark);
  outline: 2px solid var(--c-red);
  outline-offset: 3px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav-toggle { display: block; }

  /* ── Nav overlay: panel full-height fijo bajo el header ── */
  .main-nav {
    display: block;
    position: fixed;
    top: 66px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99;
    background: var(--c-red);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    /* Estado oculto con transición */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
  }

  .main-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 0.22s ease, transform 0.22s ease;
  }

  /* Lista de primer nivel */
  .main-nav > ul {
    flex-direction: column;
    gap: 0;
    padding: 0 0 48px;
    margin: 0;
    list-style: none;
  }

  .main-nav > ul > li {
    border-bottom: 1px solid rgba(255,255,255,0.12);
  }

  /* Todos los links del nav */
  .main-nav a {
    display: flex;
    align-items: center;
    font-size: 15px;
    font-weight: 500;
    padding: 0 20px;
    min-height: 52px;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0;
    border-bottom: none !important;
  }

  /* Items padre: chevron a la derecha */
  .has-children > a {
    justify-content: space-between;
  }

  .has-children > a::after {
    content: '';
    flex-shrink: 0;
    display: block;
    width: 9px;
    height: 9px;
    border-right: 2px solid rgba(255,255,255,0.55);
    border-bottom: 2px solid rgba(255,255,255,0.55);
    transform: rotate(45deg);
    transition: transform 0.2s;
    margin-left: 10px;
  }

  .has-children > a[aria-expanded="true"]::after {
    transform: rotate(-135deg);
  }

  /* Submenús */
  .main-nav .sub-menu {
    position: static !important;
    transform: none !important;
    min-width: 0 !important;
    max-height: none !important;
    border: none !important;
    box-shadow: none !important;
    background: rgba(0,0,0,0.18);
    border-left: 3px solid rgba(255,255,255,0.28) !important;
    margin: 0 0 0 20px;
    padding: 4px 0 8px;
    flex-direction: column;
  }

  .main-nav .sub-menu a {
    min-height: 44px;
    padding: 0 14px !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    color: rgba(255,255,255,0.8) !important;
    background: transparent !important;
  }

  /* ── Resto responsive ── */
  .hero__title { font-size: 1.75rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-columns { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-newsletter { flex-direction: column; align-items: flex-start; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .hero__cta { padding: 12px 24px; min-height: 44px; }
  .footer-newsletter__submit { padding: 12px 18px; min-height: 44px; }
  .footer-newsletter__input { padding: 12px 14px; min-height: 44px; min-width: 0; flex: 1; }
}

@media (max-width: 480px) {
  .hero { padding: 36px 0; }
  .hero__title { font-size: 1.5rem; }
  .footer-columns { grid-template-columns: 1fr; }
}
