/*
Theme Name: Instituto Jerez Bosque
Theme URI: https://institutojerez.cl/
Author: Instituto Jerez
Author URI: https://institutojerez.cl/
Description: Tema autónomo de estilo académico en verde bosque, salvia y ámbar para el Instituto Jerez.
Version: 1.1.0
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: instituto-jerez-bosque
Tags: block-patterns, full-site-editing, education, one-column, custom-colors, custom-logo, editor-style, accessibility-ready
*/

:root {
  --ij-night: #123B3A;
  --ij-night-soft: #1d5550;
  --ij-teal: #7A8F74;
  --ij-teal-deep: #4d6854;
  --ij-copper: #d28a47;
  --ij-copper-soft: #f0c99a;
  --ij-ivory: #f4f1e8;
  --ij-paper: #fffefb;
  --ij-ink: #263332;
  --ij-muted: #66716e;
  --ij-line: rgba(18, 59, 58, .14);
  --ij-line-strong: rgba(18, 59, 58, .23);
  --ij-radius-sm: 10px;
  --ij-radius: 20px;
  --ij-radius-lg: 32px;
  --ij-shadow-sm: 0 9px 30px rgba(18, 59, 58, .07);
  --ij-shadow: 0 24px 70px rgba(18, 59, 58, .12);
}

html { scroll-behavior: smooth; }
body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background: var(--ij-ivory);
}
.wp-site-blocks { min-height: 100vh; }
main { overflow: clip; }
a { text-underline-offset: .26em; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; }
p { text-wrap: pretty; }

/* Accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(210, 138, 71, .72);
  outline-offset: 3px;
}

/* Header */
.ij-topline {
  min-height: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  background: var(--ij-night);
}
.ij-topline p {
  margin: 0;
  color: rgba(255,255,255,.82);
  font-size: .68rem;
  font-weight: 720;
  letter-spacing: .145em;
  text-transform: uppercase;
}
.ij-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 244, 235, .94) !important;
  border-bottom: 1px solid var(--ij-line);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 24px rgba(18, 59, 58, .035);
}
.admin-bar .ij-site-header { top: 32px; }
.ij-brand-mark {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 2.8rem;
  border: 1px solid rgba(210, 138, 71, .5);
  border-radius: 50%;
  background: linear-gradient(145deg, #fffefb, #e3eae1);
  color: var(--ij-night);
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.5);
  font-family: Iowan Old Style, Baskerville, "Palatino Linotype", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -.06em;
}
.ij-brand-copy { min-width: 0; }
.ij-brand-copy .wp-block-site-title {
  margin: 0;
  line-height: 1;
  letter-spacing: -.028em;
}
.ij-brand-copy .ij-brand-subtitle {
  margin: .38rem 0 0;
  color: var(--ij-teal-deep);
  font-size: .64rem;
  font-weight: 720;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.wp-block-navigation { gap: clamp(.75rem, 1.7vw, 1.45rem); }
.wp-block-navigation a {
  position: relative;
  text-decoration: none;
  transition: color .18s ease;
}
.wp-block-navigation a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -.45rem;
  height: 2px;
  background: var(--ij-copper);
  transition: right .2s ease;
}
.wp-block-navigation a:hover,
.wp-block-navigation .current-menu-item > a,
.wp-block-navigation .current-menu-ancestor > a { color: var(--ij-copper) !important; }
.wp-block-navigation a:hover::after,
.wp-block-navigation .current-menu-item > a::after,
.wp-block-navigation .current-menu-ancestor > a::after { right: 0; }
.wp-block-navigation__responsive-container.is-menu-open {
  padding: 2rem;
  background: var(--ij-ivory) !important;
  color: var(--ij-night) !important;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
  gap: 1.15rem;
  align-items: flex-start;
}

/* Buttons */
.wp-block-button__link,
button,
input[type="submit"] {
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}
.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover,
button:hover,
input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(18, 59, 58, .18);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: rgba(122, 143, 116, .085);
  border-color: var(--ij-teal);
}

/* Front page hero */
.home main .wp-block-post-content > .wp-block-group:first-child {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: min(77vh, 800px);
  display: flex;
  align-items: center;
  background:
    radial-gradient(circle at 88% 17%, rgba(210,138,71,.17), transparent 27%),
    radial-gradient(circle at 69% 85%, rgba(122,143,116,.14), transparent 30%),
    linear-gradient(132deg, #fffefb 0%, #e8eee8 58%, #dde6db 100%) !important;
  border-bottom: 1px solid var(--ij-line);
}
.home main .wp-block-post-content > .wp-block-group:first-child::before,
.home main .wp-block-post-content > .wp-block-group:first-child::after {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  width: clamp(18rem, 29vw, 27rem);
  aspect-ratio: 1;
  right: clamp(5.8rem, 9vw, 9.5rem);
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
}
.home main .wp-block-post-content > .wp-block-group:first-child::before {
  content: "";
  border: 1px solid rgba(18,59,58,.14);
  box-shadow:
    0 0 0 2.2rem rgba(18,59,58,.025),
    0 0 0 4.4rem rgba(122,143,116,.026),
    0 0 0 6.6rem rgba(210,138,71,.019);
}
.home main .wp-block-post-content > .wp-block-group:first-child::after {
  content: "IJ";
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 0 .08em .07em 0;
  color: rgba(18,59,58,.052);
  font-family: Iowan Old Style, Baskerville, "Palatino Linotype", Georgia, serif;
  font-size: clamp(7rem, 13vw, 12.5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.09em;
}
.home main .wp-block-post-content > .wp-block-group:first-child > * {
  position: relative;
  z-index: 2;
}
.home main .wp-block-post-content > .wp-block-group:first-child h1 {
  max-width: 14.5ch;
  margin-top: 1.55rem;
  font-size: clamp(3.5rem, 7.9vw, 7.6rem) !important;
  line-height: .92 !important;
  letter-spacing: -.062em;
}
.home main .wp-block-post-content > .wp-block-group:first-child p:first-child {
  display: inline-flex;
  margin-bottom: .2rem;
  padding: .52rem .82rem;
  border: 1px solid rgba(122,143,116,.28);
  border-radius: 999px;
  background: rgba(255,255,255,.48);
  color: var(--ij-teal-deep);
  box-shadow: 0 7px 26px rgba(18,59,58,.035);
}
.home main .wp-block-post-content > .wp-block-group:first-child .wp-block-buttons {
  position: relative;
  z-index: 5;
  gap: .9rem;
}
.home main .wp-block-post-content > .wp-block-group:first-child .wp-block-button {
  position: relative;
  z-index: 6;
}

/* Front sections */
.home .ij-card {
  height: 100%;
  padding: clamp(1.6rem, 3vw, 2.35rem) !important;
  border: 1px solid var(--ij-line);
  border-radius: var(--ij-radius) !important;
  background: linear-gradient(160deg, rgba(255,255,255,.92), rgba(255,253,248,.74)) !important;
  box-shadow: var(--ij-shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.home .ij-card::before {
  content: "";
  display: block;
  width: 2.4rem;
  height: 3px;
  margin-bottom: 1.25rem;
  background: linear-gradient(90deg, var(--ij-copper), var(--ij-teal));
}
.home .ij-card:hover {
  transform: translateY(-6px);
  border-color: rgba(210,138,71,.45);
  box-shadow: var(--ij-shadow);
}
.home main .wp-block-post-content > .wp-block-group:nth-of-type(3) {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 13% 20%, rgba(255,255,255,.08), transparent 24%),
    linear-gradient(132deg, #4f2e3f 0%, #4d665a 100%) !important;
}
.home main .wp-block-post-content > .wp-block-group:nth-of-type(3)::before {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
}
.home main .wp-block-post-content > .wp-block-group:nth-of-type(3)::after {
  content: "♪";
  position: absolute;
  pointer-events: none;
  right: 3vw;
  bottom: -5.6rem;
  color: rgba(255,255,255,.06);
  font-family: Georgia, serif;
  font-size: clamp(12rem, 24vw, 23rem);
  transform: rotate(-7deg);
}
.home main .wp-block-post-content > .wp-block-group:nth-of-type(3) > * {
  position: relative;
  z-index: 2;
}
/* Botón de la sección Educación musical: evita fondo y texto blancos */
.home main .wp-block-post-content > .wp-block-group:nth-of-type(3) .wp-block-button__link,
.home main .wp-block-post-content > .wp-block-group:nth-of-type(3) .wp-block-button.is-style-outline .wp-block-button__link {
  background: var(--ij-copper) !important;
  border-color: var(--ij-copper) !important;
  color: #ffffff !important;
  opacity: 1 !important;
  box-shadow: 0 10px 25px rgba(49, 27, 40, .18);
}
.home main .wp-block-post-content > .wp-block-group:nth-of-type(3) .wp-block-button__link:hover,
.home main .wp-block-post-content > .wp-block-group:nth-of-type(3) .wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: #c79a62 !important;
  border-color: #c79a62 !important;
  color: #ffffff !important;
}
.home main .wp-block-post-content > .wp-block-group:last-child > .wp-block-group {
  border-top: 1px solid rgba(210,138,71,.48) !important;
  border-bottom: 1px solid rgba(210,138,71,.48) !important;
  border-radius: var(--ij-radius-lg);
  background: linear-gradient(135deg, rgba(255,255,255,.42), rgba(255,255,255,.1));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.26);
}

/* Interior pages */
.ij-page-main {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,.63), rgba(255,255,255,0) 24rem),
    var(--ij-ivory);
}
.ij-page-main::before {
  content: "";
  position: absolute;
  pointer-events: none;
  top: 2.2rem;
  right: -8rem;
  width: 24rem;
  height: 24rem;
  border: 1px solid rgba(122,143,116,.1);
  border-radius: 50%;
}
.ij-page-main > * { position: relative; z-index: 2; }
.ij-page-heading {
  position: relative;
  padding-bottom: 2.35rem;
  margin-bottom: clamp(2.5rem, 6vw, 4.2rem);
  border-bottom: 1px solid var(--ij-line);
}
.ij-page-heading::before {
  content: "Instituto Jerez";
  display: block;
  margin-bottom: 1rem;
  color: var(--ij-teal-deep);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .71rem;
  font-weight: 750;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.ij-page-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 5.6rem;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ij-copper), var(--ij-teal));
}
.ij-page-heading .wp-block-post-title,
.ij-page-heading h1 {
  max-width: 17ch;
  margin: 0;
  font-size: clamp(3rem, 6vw, 5.9rem) !important;
  line-height: .96;
  letter-spacing: -.055em;
}
body.page:not(.home) .wp-block-post-content,
body.single-post .wp-block-post-content { max-width: 880px; }
body.page:not(.home) .wp-block-post-content > p:first-child,
body.single-post .wp-block-post-content > p:first-child {
  color: var(--ij-night-soft);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.75;
}
@media (min-width: 782px) {
  body.page:not(.home) .wp-block-post-content > p:not(.has-text-align-center):not(.has-text-align-right):not(.ij-no-justify),
  body.single-post .wp-block-post-content > p:not(.has-text-align-center):not(.has-text-align-right):not(.ij-no-justify) {
    text-align: justify;
    text-justify: inter-word;
    -webkit-hyphens: auto;
    hyphens: auto;
  }
}
body.page:not(.home) .wp-block-post-content h2,
body.single-post .wp-block-post-content h2 {
  position: relative;
  margin-top: clamp(3.4rem, 7vw, 5.8rem);
  padding-top: 1.2rem;
  border-top: 1px solid var(--ij-line-strong);
  font-size: clamp(2.05rem, 4vw, 3.25rem);
}
body.page:not(.home) .wp-block-post-content h2::before,
body.single-post .wp-block-post-content h2::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 3.5rem;
  height: 3px;
  background: var(--ij-copper);
}
body.page:not(.home) .wp-block-post-content h3,
body.single-post .wp-block-post-content h3 {
  margin-top: 2.2rem;
  color: var(--ij-teal-deep);
  font-size: clamp(1.35rem, 2.4vw, 1.82rem);
}
body.page:not(.home) .wp-block-post-content > .wp-block-columns {
  gap: 1.15rem;
  margin-top: 1.6rem;
  margin-bottom: 2.2rem;
}
body.page:not(.home) .wp-block-post-content > .wp-block-columns > .wp-block-column {
  padding: 1.45rem;
  border: 1px solid var(--ij-line);
  border-radius: var(--ij-radius);
  background: rgba(255,253,248,.8);
  box-shadow: 0 10px 32px rgba(18,59,58,.045);
}
body.page:not(.home) .wp-block-post-content > .wp-block-columns > .wp-block-column h3 {
  margin-top: 0;
}
body.page:not(.home) .wp-block-post-content ul,
body.page:not(.home) .wp-block-post-content ol,
body.single-post .wp-block-post-content ul,
body.single-post .wp-block-post-content ol { padding-left: 1.2rem; }
body.page:not(.home) .wp-block-post-content li,
body.single-post .wp-block-post-content li {
  margin-bottom: .68rem;
  padding-left: .35rem;
}
body.page:not(.home) .wp-block-post-content li::marker,
body.single-post .wp-block-post-content li::marker {
  color: var(--ij-copper);
  font-weight: 750;
}
.wp-block-quote {
  margin: 3rem 0;
  padding: 1.6rem 1.85rem;
  border-left: 4px solid var(--ij-copper) !important;
  border-radius: 0 14px 14px 0;
  background: rgba(255,255,255,.62);
  box-shadow: var(--ij-shadow-sm);
}

/* Blog */
.ij-post-card {
  overflow: hidden;
  border: 1px solid var(--ij-line);
  border-radius: var(--ij-radius);
  background: var(--ij-paper);
  box-shadow: var(--ij-shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.ij-post-card:hover { transform: translateY(-4px); box-shadow: var(--ij-shadow); }
.ij-post-card .wp-block-post-title a { text-decoration: none; }
.ij-post-meta { color: var(--ij-teal-deep); letter-spacing: .04em; text-transform: uppercase; }

/* Forms */
main form { margin-top: 2rem; }
main label {
  display: block;
  margin-bottom: .45rem;
  color: var(--ij-night);
  font-size: .93rem;
  font-weight: 720;
}
main input[type="text"],
main input[type="email"],
main input[type="url"],
main input[type="tel"],
main input[type="search"],
main textarea,
main select {
  box-sizing: border-box;
  width: 100%;
  padding: .92rem 1rem;
  border: 1px solid rgba(18,59,58,.22);
  border-radius: 12px;
  background: rgba(255,255,255,.82);
  color: var(--ij-ink);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}
main input:focus,
main textarea:focus,
main select:focus {
  outline: 3px solid rgba(122,143,116,.17);
  border-color: var(--ij-teal);
}
main textarea { min-height: 11rem; resize: vertical; }

/* Footer */
.ij-site-footer {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 14%, rgba(122,143,116,.27), transparent 28%),
    radial-gradient(circle at 89% 78%, rgba(210,138,71,.14), transparent 24%),
    linear-gradient(135deg, #321b29, #563446) !important;
}
.ij-site-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--ij-copper), var(--ij-teal), var(--ij-copper));
}
.ij-site-footer::after {
  content: "IJ";
  position: absolute;
  pointer-events: none;
  right: -1rem;
  bottom: -4rem;
  color: rgba(255,255,255,.035);
  font-family: Iowan Old Style, Baskerville, Georgia, serif;
  font-size: clamp(10rem, 22vw, 20rem);
  font-weight: 650;
  line-height: .75;
}
.ij-site-footer > * { position: relative; z-index: 2; }
.ij-site-footer a { color: #fff !important; }
.ij-site-footer a:hover { color: #e5c89e !important; }
.ij-footer-kicker {
  color: #e5c89e;
  font-size: .71rem;
  font-weight: 720;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.ij-footer-list { list-style: none; padding-left: 0; }
.ij-footer-list li { margin-bottom: .62rem; }

/* 404 / search */
.ij-empty-state {
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px solid var(--ij-line);
  border-radius: var(--ij-radius-lg);
  background: rgba(255,253,248,.8);
  box-shadow: var(--ij-shadow-sm);
}

@media (max-width: 980px) {
  .ij-brand-copy .ij-brand-subtitle { display: none; }
  .wp-block-navigation { font-size: .78rem; }
}
@media (max-width: 781px) {
  .admin-bar .ij-site-header { top: 46px; }
  .ij-topline { display: none; }
  .ij-site-header { top: 0; }
  .ij-brand-mark { width: 2.55rem; height: 2.55rem; flex-basis: 2.55rem; }
  .home main .wp-block-post-content > .wp-block-group:first-child { min-height: auto; }
  .home main .wp-block-post-content > .wp-block-group:first-child h1 {
    max-width: 11ch;
    font-size: clamp(3rem, 13vw, 5rem) !important;
  }
  .home main .wp-block-post-content > .wp-block-group:first-child::before,
  .home main .wp-block-post-content > .wp-block-group:first-child::after { display: none; }
  .ij-page-heading .wp-block-post-title,
  .ij-page-heading h1 { font-size: clamp(2.7rem, 13vw, 4.7rem) !important; }
  body.page:not(.home) .wp-block-post-content > p,
  body.single-post .wp-block-post-content > p {
    text-align: left;
    -webkit-hyphens: none;
    hyphens: none;
  }
  body.page:not(.home) .wp-block-post-content > .wp-block-columns > .wp-block-column { padding: 1.25rem; }
}
@media (max-width: 520px) {
  .ij-brand-copy .wp-block-site-title { font-size: 1.25rem !important; }
  .home main .wp-block-post-content > .wp-block-group:first-child p:first-child {
    border-radius: 10px;
    line-height: 1.4;
  }
  .wp-block-buttons { width: 100%; }
  .wp-block-button { width: 100%; }
  .wp-block-button__link { width: 100%; box-sizing: border-box; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
