/* =========================================================
   COMUNA 16 — hoja de estilos compartida
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Encode+Sans+Condensed:wght@400;500;600;700;800&display=swap');

:root{
  --navy:        #1c3040;
  --navy-soft:   #24404f;
  --mint:        #57d1b8;
  --mint-dark:   #3fae99;
  --mint-pale:   #eafaf6;
  --red:         #ff3b30;
  --bg:          #ffffff;
  --bg-header:   #eef4f6;
  --text:        #2b2b2b;
  --text-soft:   #5b6773;
  --rule:        #e6ebee;
  --font-head:   'Encode Sans Condensed', 'Segoe UI', sans-serif;
  --font-body:   'Encode Sans Condensed', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --maxw:        1500px;
  --header-h:    160px;
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin:0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display:block; }
ul{ list-style:none; margin:0; padding:0; }

.wrap{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------------------------------------
   HEADER
   --------------------------------------------------------- */
.site-header{
  background: var(--bg-header);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow .2s ease;
}
.site-header .wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  height: var(--header-h);
  transition: height .2s ease;
}
.logo img{ height:auto; max-height:120px; width:auto; max-width:100%; transition: max-height .2s ease; }

.site-header.is-stuck{ box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.site-header.is-stuck .wrap{ height: calc(var(--header-h) / 2); }
.site-header.is-stuck .logo img{ max-height:60px; }

.main-nav{ display:flex; align-items:center; gap:6px; }
.main-nav a{
  font-family: var(--font-head);
  font-weight:700;
  font-size:24px;
  color: var(--navy);
  padding:10px 16px;
  border-radius:8px;
  transition: color .15s ease, background .15s ease;
}
.main-nav a:hover{ color: var(--mint-dark); background: rgba(87,209,184,.12); }
.main-nav a.active{ color: var(--mint-dark); }

.nav-toggle{ display:none; background:none; border:none; cursor:pointer; }
.nav-toggle svg{ width:26px; height:26px; color:var(--navy); }

/* ---------------------------------------------------------
   PAGE TITLE BAND (category page)
   --------------------------------------------------------- */
.page-title-band{
  background: var(--bg-header);
  padding: 46px 0;
  text-align:center;
  margin-bottom:44px;
}
.page-title-band h1{
  font-family: var(--font-head);
  font-weight:800;
  font-size:2.4rem;
  color: var(--navy);
  margin:0;
}

/* ---------------------------------------------------------
   TAG / BADGE
   --------------------------------------------------------- */
.tag{
  display:inline-block;
  background: var(--red);
  color:#fff;
  font-family: var(--font-head);
  font-style: italic;
  font-weight:700;
  font-size:.72rem;
  letter-spacing:.03em;
  text-transform:uppercase;
  padding:5px 12px;
  border-radius:2px;
  margin-bottom:12px;
}
.tag + .tag{ margin-left:6px; }
.tags-row{ margin-bottom:12px; }
.tags-row .tag{ margin-bottom:0; }

/* ---------------------------------------------------------
   CATEGORY ARCHIVE LIST
   --------------------------------------------------------- */
.archive-layout{
  display:grid;
  grid-template-columns: 1fr 300px;
  gap:56px;
  align-items:start;
  padding-bottom: 60px;
}

.post-list-item{
  display:grid;
  grid-template-columns: 260px 1fr;
  gap:28px;
  padding: 30px 0;
  border-bottom: 1px solid var(--rule);
}
.post-list-item:first-child{ padding-top:0; }

.post-list-item .thumb{
  width:100%;
  aspect-ratio: 16/10.5;
  overflow:hidden;
  border-radius:4px;
  background:#ddd;
}
.post-list-item .thumb img{
  width:100%; height:100%; object-fit:cover;
}

.post-list-item h2{
  font-family: var(--font-head);
  font-weight:700;
  font-size:28px;
  line-height:1.28;
  margin: 0 0 10px;
}
.post-list-item h2 a{ color: var(--mint-dark); }
.post-list-item h2 a:hover{ color: var(--navy); }

.post-list-item p{
  color: var(--text-soft);
  font-size:18px;
  line-height:1.3;
  margin:0;
}

/* pagination */
.pagination{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top: 20px;
  justify-content:center;
}
.pagination a, .pagination span{
  display:flex; align-items:center; justify-content:center;
  width:38px; height:38px;
  border-radius:50%;
  font-family: var(--font-head);
  font-weight:600;
  font-size:.92rem;
  color: var(--navy);
}
.pagination .current{
  background: var(--mint);
  color:#fff;
}
.pagination a:hover{ background: var(--mint-pale); }
.pagination .next{ color: var(--mint-dark); }

/* ---------------------------------------------------------
   SIDEBAR — "Lo Ultimo"
   --------------------------------------------------------- */
.sidebar h3{
  font-family: var(--font-head);
  font-weight:800;
  font-size:1.25rem;
  color: var(--navy);
  margin: 0 0 6px;
}
.sidebar .squiggle{
  width:60px; height:14px;
  margin-bottom:18px;
  display:block;
}
.sidebar .latest-list li{
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.sidebar .latest-list li:first-child{ padding-top:0; }

.sidebar-banners{
  display:flex;
  flex-direction:column;
  gap:20px;
  margin-top:24px;
}
.sidebar-banner{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:220px;
  border-radius:4px;
  overflow:hidden;
  background: var(--bg-header);
}
.sidebar-banner img{ width:100%; height:100%; object-fit:contain; }
.sidebar .latest-list a{
  font-size:20px;
  line-height:1.3;
  color: var(--mint-dark);
  font-weight:500;
}
.sidebar .latest-list a:hover{ color: var(--navy); }

/* ---------------------------------------------------------
   HOMEPAGE — HERO
   --------------------------------------------------------- */
.home-section{ padding: 28px 0 8px; }
.home-section .section-label{
  font-family: var(--font-head);
  font-weight:700;
  font-size:1.05rem;
  color: var(--navy);
  margin-bottom:16px;
}

.hero-grid{
  display:grid;
  grid-template-columns: 1fr 320px;
  gap:20px;
  margin-bottom: 40px;
}
.hero-main{
  position:relative;
  border-radius:6px;
  overflow:hidden;
  min-height: 400px;
  background:#222;
}
.hero-main img{
  position:absolute; inset:0;
  width:100%; height:100%; object-fit:cover;
}
.hero-main .overlay{
  position:absolute; inset:0;
  background: linear-gradient(0deg, rgba(0,0,0,.82) 0%, rgba(0,0,0,.15) 55%, rgba(0,0,0,0) 100%);
}
.hero-main .hero-text{
  position:absolute; left:0; right:0; bottom:0;
  padding: 32px;
}
.hero-main h2{
  font-family: var(--font-head);
  font-weight:700;
  font-size:38px;
  line-height:1.28;
  color:#fff;
  margin:0;
  max-width: 820px;
}

.hero-list{ display:flex; flex-direction:column; gap:14px; }
.hero-list li{
  display:flex;
  gap:12px;
  align-items:flex-start;
  border-bottom: 1px solid var(--rule);
  padding-bottom:14px;
}
.hero-list li:last-child{ border-bottom:none; padding-bottom:0; }
.hero-list .thumb{
  width:78px; height:56px; flex:none;
  border-radius:4px; overflow:hidden; background:#ddd;
}
.hero-list .thumb img{ width:100%; height:100%; object-fit:cover; }
.hero-list h4{
  margin:0;
  font-family: var(--font-body);
  font-weight:600;
  font-size:18px;
  line-height:1.2;
  color: var(--navy);
}
.hero-list h4:hover{ color: var(--mint-dark); }

/* ---------------------------------------------------------
   CAROUSEL (dark cards)
   --------------------------------------------------------- */
.carousel-wrap{
  position:relative;
  margin-bottom: 40px;
}
.carousel-track{
  display:flex;
  gap:20px;
  overflow-x:auto;
  scroll-behavior:smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width:none;
}
.carousel-track::-webkit-scrollbar{ display:none; }
.carousel-card{
  position:relative;
  border-radius:6px;
  overflow:hidden;
  aspect-ratio: 4/3.1;
  background:#111;
  flex: 0 0 calc((100% - 60px)/4);
  scroll-snap-align: start;
}
.carousel-card img{
  position:absolute; inset:0;
  width:100%; height:100%; object-fit:cover;
  opacity:.85;
}
.carousel-card .overlay{
  position:absolute; inset:0;
  background: linear-gradient(0deg, rgba(0,0,0,.88) 15%, rgba(0,0,0,.05) 65%);
}
.carousel-card .cap{
  position:absolute; left:0; right:0; bottom:0;
  padding:16px;
}
.carousel-card h4{
  margin:0;
  color:#fff;
  font-family: var(--font-head);
  font-weight:600;
  font-size:22px;
  line-height:1.2;
}
.carousel-arrow{
  position:absolute; top:50%; transform:translateY(-50%);
  width:38px; height:38px;
  border-radius:50%;
  background:#fff;
  border:1px solid var(--rule);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
  z-index:2;
}
.carousel-arrow.prev{ left:-19px; }
.carousel-arrow.next{ right:-19px; }
.carousel-arrow svg{ width:16px; height:16px; color: var(--navy); }

.ad-block{
  display:flex; flex-wrap:wrap; align-items:center; justify-content:center;
  gap:20px;
  margin: 36px 0;
}
.ad-block-item{
  display:flex; align-items:center; justify-content:center;
  height:250px;
  border-radius:8px;
  overflow:hidden;
  background: var(--bg-header);
}
.ad-block-item img{
  height:100%; width:auto; max-width:100%;
  object-fit:contain;
  display:block;
}

.feature-split{
  display:grid;
  grid-template-columns: 1.6fr 1fr;
  gap:20px;
  margin-bottom: 40px;
}
.feature-split .feature-main{
  position:relative; border-radius:6px; overflow:hidden; min-height:300px; background:#111;
}
.feature-split .feature-main img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:.85; }
.feature-split .feature-main .overlay{ position:absolute; inset:0; background: linear-gradient(0deg, rgba(0,0,0,.9) 15%, rgba(0,0,0,.05) 65%); }
.feature-split .feature-main .cap{ position:absolute; left:0; right:0; bottom:0; padding:26px; }
.feature-split .feature-main h3{
  font-family: var(--font-head); color:#fff; font-weight:700; font-size:1.3rem; margin:0 0 8px;
}
.feature-split .feature-main p{ color:#d8d8d8; font-size:.88rem; margin:0; max-width:520px; }

.feature-side{ display:flex; flex-direction:column; gap:20px; }
.feature-side .card{
  position:relative; border-radius:6px; overflow:hidden; flex:1; min-height:140px; background:#111;
}
.feature-side .card img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:.85; }
.feature-side .card .overlay{ position:absolute; inset:0; background: linear-gradient(0deg, rgba(0,0,0,.88) 20%, rgba(0,0,0,.05) 65%); }
.feature-side .card .cap{ position:absolute; left:0; right:0; bottom:0; padding:16px; }
.feature-side .card h4{ color:#fff; font-family: var(--font-head); font-weight:600; font-size:.95rem; margin:0; }

/* ---------------------------------------------------------
   SINGLE POST
   --------------------------------------------------------- */
.post-layout{
  display:grid;
  grid-template-columns: 1fr 300px;
  gap:56px;
  align-items:start;
  padding: 40px 0 70px;
}
.post-header h1{
  font-family: var(--font-head);
  font-weight:800;
  font-size:2.1rem;
  line-height:1.25;
  color:#1a1a1a;
  margin: 4px 0 16px;
}
.btn-escuchar{
  display:inline-flex; align-items:center; gap:9px;
  background:#fff;
  border:1.5px solid var(--mint);
  color: var(--navy);
  border-radius:999px;
  padding:11px 20px;
  margin:2px 0 22px;
  font-family: var(--font-head);
  font-weight:700;
  font-size:.82rem;
  letter-spacing:.04em;
  cursor:pointer;
  box-shadow: 0 2px 6px rgba(28,48,64,.08);
  transition: background .15s ease, border-color .15s ease;
}
.btn-escuchar svg{ width:17px; height:17px; flex:none; }
.btn-escuchar:hover{ background: var(--mint-pale); border-color: var(--mint-dark); }
.post-figure{
  border-radius:6px;
  overflow:hidden;
  margin-bottom:26px;
}
.post-body p{
  font-size:20px;
  line-height:1.4;
  color:#2a2a2a;
  margin: 0 0 22px;
}
.post-share{
  display:flex; align-items:center; gap:10px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  margin-top:10px;
}
.share-btn{
  width:36px; height:36px; border-radius:50%;
  background: var(--navy);
  color:#fff;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  border:none;
  padding:0;
  transition: background .15s ease;
}
.share-btn:hover{ background: var(--mint-dark); }
.share-btn svg{ width:16px; height:16px; }
.share-feedback{
  font-size:.85rem;
  color: var(--mint-dark);
  font-weight:600;
}

/* ---------------------------------------------------------
   FOOTER
   --------------------------------------------------------- */
.site-footer{
  background: var(--bg);
  padding: 40px 0 46px;
  display:flex;
  justify-content:center;
  border-top: 1px solid var(--rule);
}
.site-footer img{ width:182px; height:42px; }

.back-to-top{
  position:fixed;
  right:26px; bottom:26px;
  width:44px; height:44px;
  border-radius:50%;
  background: var(--mint);
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
  cursor:pointer;
  z-index:50;
}
.back-to-top svg{ width:18px; height:18px; color:#fff; }

/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */
@media (max-width: 980px){
  :root{ --header-h: 110px; }
  .logo img{ max-height:70px; }
  .site-header.is-stuck .logo img{ max-height:50px; }

  .archive-layout, .post-layout{ grid-template-columns: 1fr; }
  .hero-grid{ grid-template-columns: 1fr; }
  .carousel-card{ flex-basis: calc((100% - 20px)/2); }
  .feature-split{ grid-template-columns: 1fr; }
  .main-nav{ display:none; }
  .main-nav.open{
    display:flex;
    flex-direction:column;
    position:absolute;
    top:100%; left:0; right:0;
    background: var(--bg-header);
    border-bottom:1px solid var(--rule);
    padding:8px 24px 16px;
    gap:2px;
  }
  .main-nav.open a{ font-size:18px; padding:10px 8px; }
  .site-header .wrap{ position:relative; }
  .nav-toggle{ display:block; }

  /* fuentes más chicas en tablet */
  .page-title-band h1{ font-size:2rem; }
  .post-header h1{ font-size:1.8rem; }
  .post-body p{ font-size:18px; }
  .post-list-item h2{ font-size:23px; }
  .post-list-item p{ font-size:16px; }
  .hero-main h2{ font-size:28px; }
  .hero-list h4{ font-size:16px; }
  .carousel-card h4{ font-size:19px; }
  .sidebar .latest-list a{ font-size:17px; }
  .ad-block-item{ height:160px; }
}
@media (max-width: 620px){
  :root{ --header-h: 90px; }
  .logo img{ max-height:52px; }
  .site-header.is-stuck .logo img{ max-height:42px; }

  .post-list-item{ grid-template-columns: 1fr; }
  .carousel-card{ flex-basis: 100%; }
  .ad-block-item{ height:100px; }
  .page-title-band{ padding:30px 0; }
  .page-title-band h1{ font-size:1.6rem; }
  .post-header h1{ font-size:1.35rem; }

  /* fuentes más chicas en móvil */
  .main-nav a{ font-size:20px; }
  .post-body p{ font-size:16px; line-height:1.45; }
  .post-list-item h2{ font-size:20px; }
  .post-list-item p{ font-size:15px; }
  .hero-main h2{ font-size:22px; }
  .hero-main .hero-text{ padding:20px; }
  .hero-list h4{ font-size:15px; }
  .carousel-card h4{ font-size:17px; }
  .feature-split .feature-main h3{ font-size:1.1rem; }
  .feature-split .feature-main p{ font-size:.82rem; }
  .feature-side .card h4{ font-size:.85rem; }
  .sidebar h3{ font-size:1.1rem; }
  .sidebar .latest-list a{ font-size:16px; }
  .btn-escuchar{ font-size:.75rem; padding:9px 16px; }
}
@media (max-width: 400px){
  .logo img{ max-height:44px; }
  .page-title-band h1{ font-size:1.4rem; }
  .post-header h1{ font-size:1.2rem; }
  .post-body p{ font-size:15px; }
  .post-list-item h2{ font-size:18px; }
  .hero-main h2{ font-size:19px; }
}