/* Estils compartits entre les pàgines i el sistema de disseny. */
* { box-sizing: border-box; }
html { scroll-padding-top: 6rem; }
body { margin: 0; color: var(--text-primary); background: var(--surface-page); font: 400 var(--text-body)/var(--leading-body) var(--font-body); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
h1, h2, h3, h4, p, ul, dl, dd, figure { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: var(--leading-heading); letter-spacing: -.025em; }
h1 { font-size: var(--text-title); }
h2 { font-size: var(--text-section); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }
p + p { margin-top: var(--space-2); }
a { color: var(--link); text-underline-offset: .19em; }
a:hover { text-decoration-thickness: .13em; }
button, input, textarea { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.contact-band :focus-visible { outline-color: var(--focus-on-action); }
.skip-link { position: fixed; top: var(--space-2); left: var(--space-2); z-index: 10; transform: translateY(-170%); background: var(--surface-page); padding: var(--space-3); }
.skip-link:focus { transform: translateY(0); }
.shell { width: min(var(--container), calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.eyebrow { font: 700 var(--text-small)/1.25 var(--font-eyebrow); letter-spacing: .08em; text-transform: uppercase; }
.lead { font: 400 var(--text-lead)/1.35 var(--font-lead); max-width: 42ch; }

.site-header { position: sticky; inset-block-start: 0; z-index: 4; background: var(--surface-page); }
.header-inner { min-height: 4.5rem; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); }
.brand { --brand-height: 2.4rem; --brand-name-size: 1.45rem; position: relative; display: grid; align-content: center; gap: .15rem; padding-inline-start: var(--space-3); min-height: var(--brand-height); line-height: 1; text-decoration: none; color: var(--text-primary); white-space: nowrap; }
.brand::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: .1667rem; background: var(--surface-action); }
.brand-name { inline-size: max-content; font: 400 var(--brand-name-size)/1 var(--font-brand-regular); transform-origin: left center; transition: transform var(--motion-brand) var(--ease-out); }
.brand-name strong { font: 700 1em/1 var(--font-stencil); }
.brand-claim { inline-size: 0; min-inline-size: 100%; text-align: center; font: 400 calc(var(--brand-name-size) * .405)/1.15 var(--font-body); transition: opacity var(--motion-brand) var(--ease-out); }
[data-expanded] .brand-name { transform: translateY(.34rem) scale(1.29); }
[data-expanded] .brand-claim { opacity: 0; }
.desktop-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2) var(--space-5); }
.desktop-nav a, .mobile-nav nav a { color: var(--text-primary); display: inline-flex; align-items: center; min-height: var(--control-height); text-decoration: none; font-size: var(--text-small); }
.desktop-nav a:hover, .mobile-nav nav a:hover { color: var(--link); text-decoration: underline; }
.mobile-nav { display: none; }

.header-inner > .language {
  font-size: var(--text-small);
  white-space: nowrap;
}

.desktop-nav { margin-inline-start: auto; }

.desktop-nav [aria-current],
.mobile-nav [aria-current] { color: var(--link); font-weight: 650; }

.claim-band { background: var(--surface-soft); padding-block: var(--section-space); }
.claim { display: grid; justify-items: start; gap: .065em; font-size: clamp(2.4rem, 5.8vw, 4.75rem); line-height: 1.02; border-inline-start: 4px solid var(--surface-action); padding-inline-start: var(--space-4); margin-bottom: var(--space-5); }
.stencil { display: inline-block; padding: .025em .15em .055em; font: 700 1em/.96 var(--font-stencil); }
.claim .stencil { margin-block-start: .08em; }
.stencil-inverse { color: var(--text-on-action); background: var(--surface-action); }
.stencil-white { color: var(--link); background: var(--surface-page); padding-block-end: .18em; }


.course-card { position: relative; isolation: isolate; overflow: hidden; padding: var(--space-5); background: var(--surface-feature); }
.course-card::before, .course-card::after, .course-card .geometry-plane {
  content: "";
  position: absolute;
  inset-block: 0;
  z-index: -1;
  pointer-events: none;
}
.course-card::before, .course-card::after, .course-card .geometry-plane { inset-inline: 0; }
.course-card::before { background: var(--surface-feature-layer-1); }
.course-card .geometry-plane { background: var(--surface-feature-layer-2); }
.course-card::after { background: var(--surface-feature-layer-3); }

/* Punts de tall de la portada en cobalt, en proporció a cada fitxa. */
.course-card--steps::before { clip-path: polygon(79% 0, 100% 0, 100% 100%, 33% 100%, 33% 70%, 63% 70%, 63% 35%, 79% 35%); }
.course-card--steps .geometry-plane { clip-path: polygon(89% 0, 100% 0, 100% 100%, 48% 100%, 48% 80%, 74% 80%, 74% 47%, 89% 47%); }
.course-card--steps::after { clip-path: polygon(100% 59%, 100% 100%, 64% 100%, 64% 90%, 85% 90%, 85% 59%); }
.course-card--diagonals::before { clip-path: polygon(90% 0, 100% 0, 100% 100%, 36% 100%); }
.course-card--diagonals .geometry-plane { clip-path: polygon(100% 10%, 100% 100%, 54% 100%); }
.course-card--diagonals::after { clip-path: polygon(100% 44%, 100% 100%, 72% 100%); }

.course-card .badge {
  display: table;
  margin: 0 0 var(--space-4) auto;
  border-inline-start: 2px solid currentColor;
  padding-inline-start: var(--space-2);
  color: var(--link);
  font: 700 .75rem/1.25 var(--font-eyebrow);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.course-card h3 { max-width: 26ch; font-size: clamp(1.5rem, 2.7vw, 1.875rem); }
.course-card p, .course-standard p { margin-block: var(--space-3); max-width: 44ch; }
.course-card a { font-size: var(--text-small); font-weight: 650; text-decoration: none; }
.course-card a:hover { text-decoration: underline; }
.area .course-card h3 > a,
.area-catalog .course-card h2 > a,
.area-catalog .course-standard h2 > a {
  color: var(--text-primary);
  font: inherit;
  text-decoration: none;
}
.area .course-card h3 > a:hover,
.area-catalog .course-card h2 > a:hover,
.area-catalog .course-standard h2 > a:hover {
  color: var(--link);
  text-decoration: underline;
}

.button { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-height: var(--control-height); border: 1px solid transparent; padding: .52rem var(--space-4); border-radius: var(--button-radius); background: var(--surface-action); color: var(--text-on-action); text-decoration: none; font-size: var(--text-small); font-weight: 650; transition: background-color var(--motion-interaction), color var(--motion-interaction), border-color var(--motion-interaction); }
.button:hover { background: var(--surface-action-hover); }
.button-light { background: var(--surface-page); color: var(--link); }
.button-light:hover:where(:not(:disabled, [aria-disabled="true"], [data-success])) {
  background: var(--surface-action-hover);
  color: var(--text-on-action);
  border-color: var(--text-on-action);
}
.button:disabled { background: var(--surface-feature); color: var(--text-secondary); cursor: default; }
.button[aria-disabled="true"] { background: var(--surface-feature); color: var(--text-secondary); cursor: default; }
.button[data-success] { background: var(--surface-success); color: var(--text-on-success); }
.button:not([data-success]) .submit-check, .button[data-success] .submit-arrow { display: none; }

.contact-band { background: var(--surface-action); color: var(--text-on-action); padding-block: var(--section-space); }

.contact-title { display: grid; justify-items: start; gap: .14em; }

.faq { border-top: 1px solid var(--rule); }
.faq:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); list-style: none; min-height: var(--control-height); padding-block: var(--space-2); font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--link); font-size: 1.45rem; line-height: 1; }
.faq[open] summary::after { content: "−"; }
.faq p { padding-block: 0 var(--space-3); font-size: .9375rem; }

.form-fields { display: grid; width: 100%; gap: var(--space-3); align-items: start; }
.field { display: grid; width: 100%; gap: var(--space-1); }
.field label { font-size: var(--text-small); font-weight: 650; }
.field label span, .field .help { font-size: var(--text-field-qualifier); font-weight: 200; }
.field input, .field textarea { width: 100%; padding: var(--space-2) var(--space-3); font-size: var(--text-field); border: 1px solid var(--field-border); border-radius: var(--field-radius); min-height: var(--control-height); color: var(--text-primary); background: var(--surface-page); }
.field textarea { min-height: 8rem; resize: vertical; }
.field :is(input,textarea)[aria-invalid="true"] { box-shadow: inset 3px 0 var(--field-invalid); }
.field-error, .form-status, .form-feedback { font-size: var(--text-small); }
.help, .field-error, .form-status, .form-feedback { line-height: 1.45; }
.field-error, .form-feedback, .form-status { color: var(--text-feedback-on-action); }
.field-error { font-style: italic; }
.form-feedback, .form-status[data-success] { padding-inline-start: var(--space-3); border-inline-start: 2px solid var(--rule-feedback-on-action); }

.contact-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: clamp(2rem, 6vw, 5rem);
  margin-top: var(--space-6);
}

.contact-panel { padding: clamp(1.25rem, 3vw, 1.75rem); }
.contact-panel .contact-title { margin-block-end: var(--space-5); }

.contact-form { display: grid; justify-items: start; gap: var(--space-3); min-width: 0; }

.bar-list { list-style: none; padding: 0; margin-top: var(--space-3); }
.bar-list li { position: relative; padding-inline-start: var(--space-4); }
.bar-list li + li { margin-top: var(--space-2); }
.bar-list li::before { content: ""; position: absolute; inset-inline-start: 0; inset-block-start: .53em; width: .19rem; height: .54em; background: var(--surface-action); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); margin-top: var(--space-3); }
.actions > a:not(.button) { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--control-height); }
.contact-note { font-size: var(--text-small); }
.contact-form .contact-note a { color: inherit; }

.contact-form .form-status:empty {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
}

@media (width > 46rem) {
  [data-form-layout="curs"] .form-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.funding-note { position: relative; max-inline-size: var(--content-panel-max); padding: var(--space-4) var(--space-5) var(--space-4) var(--space-6); background: var(--surface-alternative); }
.funding-note::before { content: ""; position: absolute; inset-block: var(--space-4); inset-inline-start: var(--space-3); width: 4px; background: var(--accent-alternative); }
.funding-note .eyebrow { color: var(--text-alternative); margin-bottom: var(--space-2); }

.photo-header { isolation: isolate; overflow: hidden; min-height: 12.5rem; display: flex; align-items: center; position: relative; padding: var(--space-4); background: var(--surface-page); }
.photo-image { position: absolute; z-index: -2; inset: 0 0 0 auto; width: 68%; background: var(--photo) center / cover no-repeat; transform-origin: 75% center; }
.photo-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg,var(--surface-page),rgb(255 255 255 / .86) 26%,transparent 90%); }
.photo-header::before, .photo-header::after, .photo-plane {
  content: "";
  position: absolute;
  inset-block: 0;
  z-index: -1;
  pointer-events: none;
}
.photo-header::before { background: rgb(255 255 255 / .61); }
.photo-plane { background: rgb(255 255 255 / .31); }
.photo-header::after { background: rgb(255 255 255 / .17); }

.photo-video::before, .photo-video::after, .photo-video .photo-plane {
  inset-inline-start: -100%;
  transform: skewX(var(--diagonal-skew));
  transform-origin: top left;
}
.photo-video::before { width: 166%; }
.photo-video .photo-plane { width: 176%; }
.photo-video::after { width: 185%; }

.photo-ia::before, .photo-ia::after, .photo-ia .photo-plane { inset-inline: 0; }
.photo-ia::before { clip-path: polygon(0 0, 66% 0, 66% 38%, 58% 38%, 58% 72%, 49% 72%, 49% 100%, 0 100%); }
.photo-ia .photo-plane { clip-path: polygon(0 0, 76% 0, 76% 47%, 68% 47%, 68% 79%, 58% 79%, 58% 100%, 0 100%); }
.photo-ia::after { clip-path: polygon(0 0, 85% 0, 85% 55%, 77% 55%, 77% 86%, 68% 86%, 68% 100%, 0 100%); }
.photo-header[data-entered] .photo-image { animation: photo-entrance var(--motion-photo) var(--ease-out) both; }
@keyframes photo-entrance { from { transform: scale(1); } to { transform: scale(1.04); } }
.photo-ia { --photo: url("../recursos/formacio-ia.jpg"); }
.photo-video { --photo: url("../recursos/video-mobil.jpg"); }

.portrait { position: relative; isolation: isolate; width: min(100% - .75rem, 16rem); margin-bottom: var(--space-4); }
.portrait::before { content: ""; position: absolute; inset: 0; z-index: -1; transform: translate(.7rem,.7rem); background: var(--surface-feature); }
.portrait img { display: block; width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: 50% 40%; }
.carousel { border-top: 1px solid var(--rule); padding-top: var(--space-5); }
.logo-window { list-style: none; display: flex; gap: var(--space-3); overflow-x: auto; padding: var(--space-2) 0; margin-top: var(--space-3); scrollbar-width: none; }
.logo-window li { display: grid; place-items: center; flex: 0 0 calc((100% - 4 * var(--space-3)) / 5); min-height: 4.4rem; }
.logo-window img { display: block; width: auto; height: auto; max-width: min(92%,var(--logo-width,10rem)); max-height: var(--logo-height,2.8rem); object-fit: contain; filter: grayscale(1); transition: filter var(--motion-interaction); }
.logo-periodistes { --logo-height: 3.25rem; }
.logo-diputacio { --logo-width: 8.8rem; }
.logo-salut { --logo-width: 10.5rem; }
.logo-barcelona { --logo-width: 9.6rem; --logo-height: 3rem; }
.logo-cooperatives { --logo-height: 3rem; }
@media (hover: hover) { .logo-window li:hover img { filter: grayscale(0); } }

.site-footer { color: var(--text-secondary); background: var(--surface-page); }
.footer-links { display: flex; flex-wrap: wrap; list-style: none; align-items: center; column-gap: var(--space-4); row-gap: var(--space-1); padding: var(--space-4) 0; font-size: var(--text-small); }
.footer-links li { display: flex; align-items: center; position: relative; gap: var(--space-1); }
.footer-links a { color: inherit; }
.footer-links li + li::before { content: ""; position: absolute; inset-inline-start: -.55rem; width: 1px; height: .65em; background: var(--field-border); }
.footer-links li[data-row-start]::before { display: none; }
.linkedin { display: inline-grid; place-items: center; width: 1rem; height: 1rem; border-radius: 50%; background: var(--text-secondary); color: var(--surface-page); font: 700 .65rem/1 Arial, sans-serif; }


@media (max-width: 46rem) {
  .header-inner {
    gap: var(--space-2);
    min-height: 3.75rem;
  }

  .header-inner > .language { font-size: .75rem; }

  .contact-content { grid-template-columns: minmax(0, 1fr); }
  .desktop-nav { display: none; }
  .mobile-nav { display: block; position: relative; margin-inline-start: auto; }
  .mobile-nav summary { padding: .65rem 0 .65rem .5rem; min-height: var(--control-height); color: var(--link); }
  .mobile-nav nav { position: absolute; inset-inline-end: 0; inset-block-start: 100%; background: var(--surface-page); border: 1px solid var(--rule); width: max-content; padding: var(--space-2) var(--space-4); }
  .mobile-nav nav a { display: flex; }
  .logo-window li { flex-basis: clamp(8.25rem,42%,13rem); }
}
@media (max-width: 24rem) {
  .brand { --brand-name-size: 1.24rem; }
  [data-expanded] .brand-name { transform: translateY(.34rem) scale(1.22); }
}
@media (prefers-reduced-motion: no-preference) {
  [data-awaiting] { opacity: 0; }

  [data-reveal][data-entered] {
    animation: enter-up var(--motion-reveal) var(--ease-out) backwards;
    animation-delay: var(--reveal-delay, 0ms);
  }
}

@keyframes enter-up {
  from { opacity: 0; transform: translateY(1.5rem); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
  .logo-window [data-copy] { display: none; }
  .photo-header[data-entered] .photo-image { animation: none; }
}

/* Amb sis opcions, el menú es recull abans que la capçalera quedi estreta. */
@media (min-width: 46.001rem) and (max-width: 57rem) {
  .desktop-nav { display: none; }
  .mobile-nav { display: block; position: relative; margin-inline-start: auto; }
  .mobile-nav summary { padding: .65rem 0 .65rem .5rem; min-height: var(--control-height); color: var(--link); }
  .mobile-nav nav { position: absolute; inset-inline-end: 0; inset-block-start: 100%; background: var(--surface-page); border: 1px solid var(--rule); width: max-content; padding: var(--space-2) var(--space-4); }
  .mobile-nav nav a { display: flex; }
}
