:root{
  --ink:#1a1816;
  --bone:#f4f1ea;
  --belt-red:#a3272c;
  --belt-red-dark:#7c1d21;
  --stone:#8a8378;
  --stone-light:#d8d3c8;
  --white:#ffffff;
  --shadow: 0 8px 24px rgba(0,0,0,.18);
}
*{box-sizing:border-box;margin:0;padding:0;}
html{scroll-behavior:smooth; scroll-padding-top: env(safe-area-inset-top,0px);}
body{
  font-family:'Source Sans 3', sans-serif;
  background:var(--bone);
  color:var(--ink);
  line-height:1.55;
  padding-top: env(safe-area-inset-top,0px);
  padding-bottom: env(safe-area-inset-bottom,0px);
  overflow-x:hidden;
}
h1,h2,h3,h4{font-family:'Oswald',sans-serif; letter-spacing:.01em; line-height:1.08;}
img{max-width:100%; display:block;}
a{color:inherit;}
.wrap{max-width:1120px; margin:0 auto; padding:0 24px;}

/* ===== NAV ===== */
header{
  position:sticky; top:0; z-index:50;
  background:var(--ink);
  border-bottom:4px solid var(--belt-red);
  top: env(safe-area-inset-top,0px);
}
.nav{display:flex; align-items:center; justify-content:space-between; padding:14px 24px; max-width:1120px; margin:0 auto;}
.brand{display:flex; align-items:center; gap:12px; color:var(--bone); text-decoration:none;}
.brand-mark{
  width:38px; height:38px; background:var(--belt-red); flex:none;
  clip-path:polygon(0 0,100% 0,100% 70%,70% 100%,0 100%);
  display:flex; align-items:center; justify-content:center;
  font-family:'Oswald',sans-serif; font-weight:700; color:var(--bone); font-size:18px;
}
.brand-name{font-family:'Oswald',sans-serif; font-size:17px; font-weight:600; letter-spacing:.03em;}
.brand-name small{display:block; font-family:'Source Sans 3',sans-serif; font-weight:400; font-size:11px; color:var(--stone-light); letter-spacing:.08em;}
nav.links{display:flex; gap:28px; font-size:15px; font-weight:500;}
nav.links a{color:var(--stone-light); text-decoration:none; padding:6px 2px; border-bottom:2px solid transparent; transition:border-color .15s, color .15s;}
nav.links a:hover{color:var(--bone); border-color:var(--belt-red);}
.menu-btn{display:none; background:none; border:none; color:var(--bone); font-size:26px; cursor:pointer; padding:4px 8px;}
@media(max-width:760px){
  nav.links{display:none; position:absolute; top:100%; left:0; right:0; background:var(--ink); flex-direction:column; gap:0; padding:8px 24px 16px; border-bottom:4px solid var(--belt-red);}
  nav.links.open{display:flex;}
  nav.links a{padding:12px 0; border-bottom:1px solid #333;}
  .menu-btn{display:block;}
}

/* ===== HERO ===== */
.hero{
  position:relative;
  background:var(--ink);
  color:var(--bone);
  padding:76px 0 90px;
  overflow:hidden;
}
.hero::before{
  content:"";
  position:absolute; inset:0;
  background-image:
    linear-gradient(var(--stone) 1px, transparent 1px),
    linear-gradient(90deg, var(--stone) 1px, transparent 1px);
  background-size:64px 64px;
  opacity:.06;
}
.hero-inner{position:relative; display:grid; grid-template-columns:1.2fr .8fr; gap:48px; align-items:center;}
@media(max-width:820px){.hero-inner{grid-template-columns:1fr;}}
.eyebrow-belt{display:flex; align-items:center; gap:10px; margin-bottom:22px;}
.belt-strip{display:flex; height:8px; width:80px;}
.belt-strip span{flex:1;}
.hero h1{font-size:clamp(2.4rem, 6vw, 4.2rem); font-weight:700; margin-bottom:20px;}
.hero h1 em{font-style:normal; color:var(--belt-red);}
.hero p.lead{font-size:1.15rem; color:var(--stone-light); max-width:46ch; margin-bottom:32px;}
.btn-row{display:flex; gap:14px; flex-wrap:wrap;}
.btn{
  display:inline-block; padding:14px 28px; font-weight:600; font-size:15px;
  text-decoration:none; border:2px solid transparent; cursor:pointer;
  transition:transform .12s ease, background .15s, color .15s, border-color .15s;
  font-family:'Source Sans 3',sans-serif;
}
.btn:active{transform:scale(.97);}
.btn-primary{background:var(--belt-red); color:var(--bone);}
.btn-primary:hover{background:var(--belt-red-dark);}
.btn-ghost{border-color:var(--stone); color:var(--bone);}
.btn-ghost:hover{border-color:var(--bone);}
.hero-figure{
  position:relative; aspect-ratio:4/5; background:var(--stone-light);
  display:flex; align-items:center; justify-content:center; color:var(--stone);
  border:3px solid var(--belt-red);
}
.hero-figure img{width:100%; height:100%; object-fit:cover;}
.hero-figure .ph-label{font-size:13px; text-align:center; padding:20px; font-family:'Source Sans 3';}

.stats{display:flex; gap:0; margin-top:56px; border-top:1px solid #3a3733; padding-top:32px; flex-wrap:wrap;}
.stat{flex:1; min-width:130px; padding-right:24px;}
.stat .num{font-family:'Oswald'; font-size:2.1rem; font-weight:700; color:var(--belt-red);}
.stat .lab{font-size:13px; color:var(--stone-light); margin-top:2px;}

/* ===== SECTION HEADERS ===== */
.section{padding:80px 0;}
.section-head{display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin-bottom:40px; border-bottom:3px solid var(--ink); padding-bottom:16px;}
.section-head h2{font-size:2rem; font-weight:600;}
.section-head .count{font-size:14px; color:var(--stone); font-weight:500;}
.section.alt{background:var(--white);}

/* ===== NOTICIAS ===== */
#noticias-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:0; border-top:1px solid var(--stone-light); border-left:1px solid var(--stone-light);}
@media(max-width:860px){#noticias-grid{grid-template-columns:1fr 1fr;}}
@media(max-width:600px){#noticias-grid{grid-template-columns:1fr;}}
.news-card{border-right:1px solid var(--stone-light); border-bottom:1px solid var(--stone-light); padding:26px; display:flex; flex-direction:column; gap:10px; background:var(--bone);}
.news-card .date{font-size:12px; color:var(--belt-red); font-weight:600;}
.news-card h3{font-size:1.15rem; font-weight:600;}
.news-card p{font-size:14px; color:#5b564e; white-space:pre-line;}
.news-card .thumb{width:100%; aspect-ratio:16/10; object-fit:cover; margin-bottom:8px; background:var(--stone-light);}
.empty-msg{padding:40px 26px; color:var(--stone); font-size:15px; grid-column:1/-1;}

/* ===== GALERIA ===== */
#galeria-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:6px;}
@media(max-width:760px){#galeria-grid{grid-template-columns:repeat(2,1fr);}}
.gal-item{position:relative; aspect-ratio:1; overflow:hidden; background:var(--stone-light); cursor:pointer;}
.gal-item img{width:100%; height:100%; object-fit:cover; transition:transform .3s;}
.gal-item:hover img{transform:scale(1.06);}
.gal-caption{position:absolute; bottom:0; left:0; right:0; background:linear-gradient(transparent, rgba(0,0,0,.75)); color:#fff; font-size:11px; padding:16px 8px 6px;}

/* ===== PROGRAMAS ===== */
.programs{display:grid; grid-template-columns:repeat(3,1fr); gap:2px; background:var(--stone-light);}
@media(max-width:760px){.programs{grid-template-columns:1fr;}}
.prog-card{background:var(--ink); color:var(--bone); padding:34px 28px;}
.prog-card h3{font-size:1.3rem; margin-bottom:10px; color:var(--bone);}
.prog-card .age{font-size:12px; color:var(--belt-red); font-weight:700; letter-spacing:.04em; margin-bottom:14px; display:inline-block;}
.prog-card p{font-size:14px; color:var(--stone-light);}

/* ===== HORARIOS ===== */
table.schedule{width:100%; border-collapse:collapse; font-size:14px;}
table.schedule th{text-align:left; padding:12px 16px; background:var(--ink); color:var(--bone); font-family:'Oswald'; font-weight:500;}
table.schedule td{padding:12px 16px; border-bottom:1px solid var(--stone-light);}
table.schedule tr:nth-child(even) td{background:#fff;}

/* ===== CONTACTO / FOOTER ===== */
footer{background:var(--ink); color:var(--stone-light); padding:56px 0 28px;}
.foot-grid{display:grid; grid-template-columns:1.3fr 1fr 1fr; gap:40px; margin-bottom:40px;}
@media(max-width:700px){.foot-grid{grid-template-columns:1fr;}}
footer h4{color:var(--bone); font-size:15px; margin-bottom:14px;}
footer p, footer a{font-size:14px; color:var(--stone-light); text-decoration:none; line-height:1.9;}
footer a:hover{color:var(--belt-red);}
.foot-bottom{border-top:1px solid #3a3733; padding-top:20px; font-size:12px; display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px;}

/* ===== ADMIN PANEL ===== */
.admin-fab{
  position:fixed; bottom:22px; right:22px; z-index:80;
  background:var(--belt-red); color:#fff; border:none; width:52px; height:52px;
  cursor:pointer; font-size:20px; box-shadow:var(--shadow);
  bottom: calc(22px + env(safe-area-inset-bottom,0px));
}
.admin-overlay{position:fixed; inset:0; background:rgba(20,18,16,.6); z-index:90; display:none; align-items:flex-start; justify-content:center; padding:32px 16px; overflow-y:auto;}
.admin-overlay.open{display:flex;}
.admin-panel{background:var(--bone); max-width:640px; width:100%; padding:30px; margin-bottom:40px; box-shadow:var(--shadow); position:relative;}
.admin-panel h2{font-size:1.4rem; margin-bottom:6px;}
.admin-panel .sub{font-size:13px; color:var(--stone); margin-bottom:24px;}
.admin-close{position:absolute; top:14px; right:16px; background:none; border:none; font-size:22px; cursor:pointer; color:var(--stone);}
.admin-tabs{display:flex; gap:0; margin-bottom:24px; border-bottom:2px solid var(--ink);}
.admin-tabs button{flex:1; padding:10px; background:none; border:none; cursor:pointer; font-weight:600; font-size:14px; color:var(--stone); font-family:'Source Sans 3';}
.admin-tabs button.active{color:var(--belt-red); border-bottom:3px solid var(--belt-red); margin-bottom:-2px;}
.admin-tab-content{display:none;}
.admin-tab-content.active{display:block;}
.field{margin-bottom:16px;}
.field label{display:block; font-size:13px; font-weight:600; margin-bottom:6px;}
.field input[type=text], .field input[type=date], .field input[type=password], .field textarea{
  width:100%; padding:10px 12px; border:1px solid var(--stone); font-family:'Source Sans 3'; font-size:14px; background:#fff;
}
.field textarea{min-height:80px; resize:vertical;}
.field input[type=file]{font-size:13px;}
.admin-panel .btn-primary{width:100%; border:none; margin-top:6px;}
.preview-thumb{width:100%; max-height:140px; object-fit:cover; margin-top:8px; display:none; background:var(--stone-light);}
.admin-list{margin-top:28px; border-top:1px solid var(--stone-light); padding-top:20px;}
.admin-list h3{font-size:14px; margin-bottom:10px; color:var(--stone);}
.admin-row{display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--stone-light); font-size:13px;}
.admin-row img{width:40px; height:40px; object-fit:cover; flex:none;}
.admin-row .name{flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.admin-row button{background:none; border:1px solid var(--stone); padding:3px 9px; cursor:pointer; font-size:12px;}
.msg-ok{background:#2e5a3a; color:#fff; padding:10px 14px; font-size:13px; margin-bottom:16px; display:none;}
.msg-err{background:var(--belt-red); color:#fff; padding:10px 14px; font-size:13px; margin-bottom:16px; display:none;}
.note{font-size:12px; color:var(--stone); margin-top:18px; border-top:1px solid var(--stone-light); padding-top:14px;}

@media(prefers-reduced-motion: reduce){ *{transition:none !important; scroll-behavior:auto !important;} }
