/* ciclesformatius.illobregat.cat — institut, paper i taller.
   Also loaded by Core iframe via Landing.embedCssUrl. */

:root,
html[data-theme="ciclesformatius"] {
  --paper: #f3efe6;
  --paper-2: #fffdf8;
  --ink: #1a1814;
  --muted: #5b564c;
  --line: #d6cfc2;
  --navy: #1b2433;
  --navy-2: #243044;
  --gold: #c48a14;
  --gold-ink: #1b2433;
  --brick: #9d3d32;
  --ok: #2f6b4f;
  --danger: #a33b2b;
  --header-h: 5.25rem;
  --wrap: 1120px;
  --gutter: 1.25rem;
  --radius: 10px;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --section: clamp(3.4rem, 7vw, 5.6rem);
  --header-bg: rgb(243 239 230 / 0.92);
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.6;
}

body.nav-open {
  overflow: hidden;
}

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

img {
  height: auto;
  outline: 1px solid rgb(26 24 20 / 0.1);
  outline-offset: -1px;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--brick);
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 80;
  padding: 0.5rem 0.85rem;
  background: var(--navy);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
}

.skip:focus {
  top: 0.75rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(var(--wrap), calc(100% - (var(--gutter) * 2)));
  margin-inline: auto;
}

.kicker {
  margin: 0 0 0.55rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brick);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
  line-height: 1.18;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  margin: 0 0 0.8rem;
}

h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.35rem);
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1.2rem;
  margin: 0 0 0.4rem;
}

p {
  text-wrap: pretty;
}

.lede {
  font-size: 1.15rem;
  max-width: 48ch;
  color: var(--muted);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 10px 28px rgb(27 36 51 / 0.06);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.brand img {
  width: 5rem;
  height: auto;
  outline: none;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 600;
}

.brand-copy span {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.nav-toggle {
  margin-left: auto;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars span {
  display: block;
}

.nav-toggle-bars {
  width: 1.1rem;
  margin: 0 auto;
}

.nav-toggle-bars span,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  height: 2px;
  background: var(--navy);
  content: "";
  display: block;
}

.nav-toggle-bars::before {
  margin-bottom: 0.28rem;
}

.nav-toggle-bars::after {
  margin-top: 0.28rem;
}

.site-nav {
  display: none;
  align-items: center;
  gap: 0.15rem 1.15rem;
  margin-left: auto;
}

.site-nav a,
.site-nav summary {
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--navy);
  padding: 0.35rem 0;
}

.site-nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--gold);
}

.site-nav a:hover,
.site-nav summary:hover {
  color: var(--brick);
}

.site-nav a.nav-cta {
  display: inline-flex;
  align-items: center;
  margin-left: 0.4rem;
  min-height: 2.65rem;
  padding: 0.65rem 1.25rem;
  background: var(--navy);
  color: var(--paper) !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 8px;
  box-shadow: none;
}

.site-nav a.nav-cta:hover {
  background: var(--brick);
  color: var(--paper) !important;
}

.nav-drop {
  position: relative;
}

.nav-drop summary {
  list-style: none;
  cursor: pointer;
}

.nav-drop summary::after {
  content: " ▾";
  font-size: 0.75em;
  opacity: 0.7;
}

.nav-drop-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 16rem;
  padding: 0.5rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 36px rgb(27 36 51 / 0.1);
  z-index: 30;
}

.nav-drop-panel a {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
}

.nav-drop-panel a:hover {
  background: var(--paper);
}

.ext-mark {
  font-size: 0.75em;
  opacity: 0.65;
}

.hero {
  position: relative;
  color: #f6f1e6;
  min-height: min(86vh, 42rem);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  outline: none;
}

.hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgb(27 36 51 / 0.88) 0%, rgb(27 36 51 / 0.55) 46%, rgb(27 36 51 / 0.22) 100%),
    linear-gradient(to top, rgb(27 36 51 / 0.45), transparent 42%);
}

.hero .wrap {
  position: relative;
  z-index: 1;
  padding: 5.5rem 0 3.4rem;
}

.hero .kicker {
  color: var(--gold);
}

.hero h1 {
  max-width: 16ch;
  color: #fffdf8;
}

.hero .lede {
  color: #e6dfd2;
}

.hero-actions,
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.btn-row {
  margin-top: 1.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.65rem 1.15rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--gold);
  color: var(--gold-ink) !important;
}

.btn-primary:hover {
  background: #d9a428;
}

.btn-ghost {
  background: transparent;
  color: inherit !important;
  border-color: currentColor;
}

.hero .btn-ghost {
  color: #fffdf8 !important;
  border-color: rgb(255 253 248 / 0.55);
}

.btn-ghost:hover {
  background: rgb(255 255 255 / 0.08);
}

.section {
  padding: var(--section) 0;
}

.section-alt {
  background: var(--paper-2);
  border-block: 1px solid var(--line);
}

.section-navy {
  background: var(--navy);
  color: #f3efe6;
}

.section-navy .kicker {
  color: var(--gold);
}

.section-navy .lede,
.section-navy p {
  color: #cfc6b6;
}

.section-head {
  max-width: 46rem;
  margin-bottom: 2rem;
}

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.4rem, 4vw, 3rem);
  align-items: center;
}

.split img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}

.paths {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.path {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.35rem 1.25rem 1.2rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
}

.path:hover {
  border-color: var(--navy);
  color: inherit;
}

.path-index {
  font-family: var(--serif);
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

.path p {
  flex: 1;
  color: var(--muted);
  margin: 0 0 1rem;
}

.path-more {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--navy);
}

.values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.value {
  padding-left: 1rem;
  border-left: 3px solid var(--gold);
}

.jobs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.jobs li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.dates {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.date-card {
  padding: 1.15rem 1.2rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.date-card time {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brick);
  margin-bottom: 0.35rem;
}

.colabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.85rem;
  align-items: center;
}

.colabs img {
  width: 100%;
  height: 4.4rem;
  object-fit: contain;
  background: var(--paper-2);
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  filter: grayscale(1);
  opacity: 0.9;
}

.quote {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.35;
  max-width: 22ch;
  margin: 1.2rem 0 0;
}

.values.spaced,
.stack-top {
  margin-top: 2rem;
}

.quote cite {
  display: block;
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-style: normal;
  color: var(--muted);
}

.modules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.modules li {
  padding: 0.7rem 0.85rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
}

.hours {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hours li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}

.hours b {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.crumbs a {
  color: var(--muted);
}

.page-hero {
  padding: 2.4rem 0 0.4rem;
}

.page-hero h1 {
  max-width: 18ch;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.gallery-block + .gallery-block {
  margin-top: 2.8rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.gallery-grid:has(> :nth-child(2):last-child) {
  grid-template-columns: 1fr 1fr;
  max-width: 46rem;
}

.gallery-grid a {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: var(--navy);
}

.gallery-grid img {
  width: 100%;
  height: 14rem;
  object-fit: cover;
  transition: transform 240ms var(--ease);
  outline: none;
}

.gallery-grid a:hover img {
  transform: scale(1.03);
}

.videos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.videos iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
}

.lightbox {
  padding: 0;
  border: 0;
  background: rgb(16 18 24 / 0.92);
  max-width: none;
  width: 100%;
  height: 100%;
}

.lightbox::backdrop {
  background: rgb(16 18 24 / 0.88);
}

.lightbox-figure {
  margin: 0;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 4rem 1rem 2rem;
}

.lightbox img {
  max-height: 78vh;
  width: auto;
  max-width: min(1100px, 92vw);
  outline: none;
}

.lightbox figcaption {
  color: #e8e0d2;
  margin-top: 0.8rem;
  text-align: center;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  top: 1rem;
  border: 0;
  background: var(--paper);
  color: var(--navy);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 8px;
  font-size: 1.3rem;
  cursor: pointer;
}

.lightbox-close {
  right: 1rem;
}

.lightbox-nav[data-lightbox-prev] {
  left: 1rem;
  top: 50%;
}

.lightbox-nav[data-lightbox-next] {
  right: 1rem;
  top: 50%;
}

.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2rem;
}

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

.contact-list li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.contact-list span {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.embed-shell {
  padding: 0.7rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 18rem;
}

.embed-shell [data-core-embed] iframe {
  width: 100%;
  border: 0;
}

.embed-form {
  font-family: var(--sans);
  color: var(--ink);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.field label {
  font-weight: 650;
  font-size: 0.92rem;
}

.req {
  color: var(--brick);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 2.85rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.field textarea {
  min-height: 7rem;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--gold) 65%, transparent);
  outline-offset: 1px;
  border-color: var(--gold);
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.88rem;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.form-status[data-state="ok"] {
  background: color-mix(in srgb, var(--ok) 14%, var(--paper-2));
  border-color: var(--ok);
}

.form-status[data-state="error"] {
  background: color-mix(in srgb, var(--danger) 12%, var(--paper-2));
  border-color: var(--danger);
}

.site-footer {
  background: var(--navy);
  color: #d8d1c4;
  padding: 3rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2rem;
}

.site-footer a {
  color: #f4efe6;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--gold);
}

.site-footer h2 {
  font-size: 1.05rem;
  margin: 0 0 0.7rem;
  color: #fffdf8;
}

.footer-brand {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin-bottom: 0.8rem;
}

.footer-brand img {
  width: 4.75rem;
  outline: none;
  background: #fff;
  border-radius: 4px;
}

.footer-quote {
  margin: 0.9rem 0 0;
  max-width: 28ch;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.4;
  color: #f4efe6;
}

.footer-quote cite {
  display: block;
  margin-top: 0.55rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-style: normal;
  color: #cfc6b6;
}

.footer-links,
.social {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.social {
  flex-direction: row;
  gap: 0.55rem;
  margin: 1rem 0 0.4rem;
}

.social a {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid rgb(244 239 230 / 0.25);
  border-radius: 8px;
}

.social svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.legal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgb(244 239 230 / 0.14);
  font-size: 0.88rem;
}

.legal-row a {
  color: #cfc6b6;
}

@media (min-width: 880px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: flex;
  }
}

@media (max-width: 879px) {
  .site-nav {
    display: none;
    position: absolute;
    inset: var(--header-h) 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.6rem 1.25rem 1.2rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    max-height: calc(100vh - var(--header-h));
    overflow: auto;
  }

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

  .site-nav a,
  .site-nav summary {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-drop-panel {
    position: static;
    box-shadow: none;
    border: 0;
    padding: 0 0 0.4rem;
    background: transparent;
  }

  .site-nav a.nav-cta {
    margin: 0.8rem 0 0;
    justify-content: center;
  }

  .split,
  .paths,
  .values,
  .dates,
  .contact-grid,
  .footer-grid,
  .videos,
  .modules,
  .jobs {
    grid-template-columns: 1fr;
  }

  .gallery-grid,
  .colabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .hours li {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .colabs {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .gallery-grid img,
  .site-header {
    transition: none;
  }

  .gallery-grid a:hover img {
    transform: none;
  }
}
