/* =========================================================
   The Language Corner — estils
   Colors de la marca (logo): blau marí + taronja
   ========================================================= */

@font-face {
    font-family: 'Outfit';
    src: url('fonts/outfit.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --navy: #2D3480;
    --navy-deep: #1E2460;
    --orange: #E8792B;
    --orange-dark: #C9601A;   /* per a text taronja sobre blanc (contrast) */
    --tile: #EEF0F4;          /* gris clar com el paviment de l'acadèmia */
    --paper: #FFFFFF;
    --ink: #20244A;
    --muted: #565B78;
    --line: #DADDE6;

    --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --radius: 14px;
    --corner: clamp(120px, 18vw, 240px); /* el gran "racó" corbat de la foto principal */
    --header-h: 76px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 12px);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    overflow-x: hidden;
}

img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
ul { list-style: none; }

.sprite { display: none; }

.ico {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:focus-visible {
    outline: 3px solid var(--orange);
    outline-offset: 3px;
    border-radius: 6px;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -100px;
    z-index: 3000;
    background: var(--navy);
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

section { padding: clamp(64px, 9vw, 112px) 0; }

h1, h2, h3 { line-height: 1.15; color: var(--navy); }

h2 {
    font-size: clamp(2rem, 3.6vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.015em;
    margin-bottom: 1.25rem;
}

.section-sub {
    color: var(--muted);
    font-size: 1.15rem;
    max-width: 60ch;
    margin-bottom: 2.5rem;
}

/* ---------- Botons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 999px;
    border: 2px solid transparent;
    font-weight: 600;
    font-size: 1.05rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-accent { background: var(--orange); color: #fff; }
.btn-accent:hover { background: var(--orange-dark); }

.btn-ghost { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-ghost:hover { background: var(--navy); color: #fff; }

.btn-light { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-light:hover { border-color: var(--navy); }

/* ---------- Capçalera ---------- */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    height: var(--header-h);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color .25s, box-shadow .25s;
}
.site-header.scrolled {
    border-bottom-color: var(--line);
    box-shadow: 0 6px 20px rgba(32, 36, 74, .06);
}

.header-inner {
    max-width: 1280px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand { margin-right: auto; display: block; }
.brand img { height: 50px; width: auto; }

.nav ul { display: flex; gap: 28px; }
.nav a {
    text-decoration: none;
    font-weight: 500;
    color: var(--ink);
    padding: 6px 0;
    background: linear-gradient(var(--orange), var(--orange)) left bottom / 0 2px no-repeat;
    transition: background-size .25s, color .2s;
}
.nav a:hover, .nav a.active { color: var(--navy); background-size: 100% 2px; }

/* Selector d'idioma */
.lang { position: relative; }
.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    font-weight: 600;
    color: var(--navy);
    cursor: pointer;
}
.lang-btn:hover { border-color: var(--navy); }
.chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s; }
.lang-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

.lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 170px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(32, 36, 74, .14);
    padding: 6px;
}
.lang-menu button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: none;
    text-align: left;
    cursor: pointer;
    font-weight: 500;
}
.lang-menu button:hover, .lang-menu button[aria-current="true"] { background: var(--tile); color: var(--navy); }

.flag-val {
    display: inline-block;
    width: 1.3em;
    height: .9em;
    background: url('img/flag-val.svg') center / cover no-repeat;
    border-radius: 2px;
    vertical-align: middle;
    border: 1px solid rgba(0, 0, 0, .1);
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 8px;
    border: 0;
    background: none;
    cursor: pointer;
}
.hamburger span {
    display: block;
    height: 3px;
    border-radius: 3px;
    background: var(--navy);
    transition: transform .25s, opacity .25s;
}

/* ---------- Inici (hero) ---------- */
.hero {
    padding-top: calc(var(--header-h) + clamp(32px, 6vw, 72px));
    padding-bottom: clamp(56px, 8vw, 96px);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
}

.hero h1 {
    font-size: clamp(2.6rem, 6vw, 4.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.02;
    margin-bottom: 1.5rem;
}

.lead {
    font-size: clamp(1.15rem, 1.6vw, 1.3rem);
    color: var(--muted);
    max-width: 34ch;
    margin-bottom: 2rem;
}

.hero-actions { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero-actions .btn-accent { grid-column: 1 / -1; }
.hero-phones { display: contents; }

/* La foto principal: cantonada gran corbada com la "C" del logo */
.hero-photo { position: relative; }

.hero-photo-frame {
    position: relative;
    z-index: 1;
    overflow: hidden;
    border-radius: var(--corner) var(--radius) var(--radius) var(--radius);
    aspect-ratio: 4 / 3.3;
    background: var(--tile);
}
.hero-photo-frame img { width: 100%; height: 100%; object-fit: cover; }

/* Arcs concèntrics del logo, al voltant de la cantonada */
.arc {
    position: absolute;
    z-index: 0;
    border-radius: 50%;
    border-style: solid;
    border-color: transparent;
    pointer-events: none;
}
.arc-1 {
    --s: calc(var(--corner) * 2 + 48px);
    width: var(--s); height: var(--s);
    top: -24px; left: -24px;
    border-width: 10px;
    border-top-color: var(--orange);
    border-left-color: var(--orange);
    transform: rotate(0deg);
}
.arc-2 {
    --s: calc(var(--corner) * 2 + 96px);
    width: var(--s); height: var(--s);
    top: -48px; left: -48px;
    border-width: 14px;
    border-top-color: var(--navy);
    border-left-color: var(--navy);
    opacity: .9;
}

/* Únic moment d'animació: la foto s'obri des del racó en carregar */
@media (prefers-reduced-motion: no-preference) {
    .hero-photo-frame { animation: reveal 1.1s cubic-bezier(.2, .7, .2, 1) both .1s; }
    .arc-1 { animation: arcIn .9s ease-out both .5s; }
    .arc-2 { animation: arcIn .9s ease-out both .7s; }
    .hero-text > * { animation: rise .7s ease-out both; }
    .hero-text > :nth-child(2) { animation-delay: .1s; }
    .hero-text > :nth-child(3) { animation-delay: .2s; }
}
@keyframes reveal {
    from { clip-path: circle(0% at 0% 0%); }
    to   { clip-path: circle(150% at 0% 0%); }
}
@keyframes arcIn {
    from { opacity: 0; transform: rotate(-35deg); }
    to   { opacity: 1; transform: rotate(0); }
}
@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Qui som ---------- */
.about { background: var(--tile); }

.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: clamp(32px, 6vw, 96px);
    align-items: start;
}
.about-sub {
    color: var(--orange-dark);
    font-weight: 600;
    font-size: 1.15rem;
    margin: -.5rem 0 1.25rem;
}
.about p:not(.about-sub) { max-width: 60ch; color: var(--muted); margin-bottom: 1rem; font-size: 1.125rem; }

.why {
    background: var(--paper);
    border-radius: var(--radius);
    padding: clamp(24px, 3vw, 36px);
    border-left: 6px solid var(--orange);
}
.why h3 { font-size: 1.4rem; margin-bottom: 1rem; }
.checklist li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    font-weight: 500;
    border-top: 1px solid var(--line);
}
.checklist li:first-child { border-top: 0; }
.checklist .ico { color: var(--orange-dark); stroke-width: 2.6; }

/* Comptador d'anys */
.stat {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--line);
}
.stat-num {
    font-size: clamp(4rem, 9vw, 6.5rem);
    font-weight: 800;
    line-height: .9;
    letter-spacing: -0.04em;
    color: var(--navy);
    font-variant-numeric: tabular-nums;
}
.stat-plus { color: var(--orange); }
.stat-label {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--navy);
    margin: 0;
    line-height: 1.2;
}

/* ---------- Serveis ---------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);   /* 8 serveis = 2 files de 4 */
    gap: 0 clamp(24px, 3vw, 40px);
    margin-top: 2.5rem;
}
@media (max-width: 1100px) {
    .services-grid { grid-template-columns: repeat(2, 1fr); }   /* 4 files de 2 */
}
.service {
    padding: 28px 0 32px;
    border-top: 2px solid var(--navy);
}
.service-ico {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: var(--orange);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin-bottom: 14px;
}
.service h3 { font-size: 1.3rem; margin-bottom: .5rem; }
.service p { color: var(--muted); max-width: 40ch; }

/* ---------- Instal·lacions ---------- */
.facilities { background: var(--tile); }

.gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: clamp(150px, 17vw, 230px);
    gap: 14px;
}
.g-item {
    position: relative;
    overflow: hidden;
    border: 0;
    padding: 0;
    border-radius: var(--radius);
    cursor: zoom-in;
    background: #dfe2ea;
}
.g-big { grid-column: span 2; grid-row: span 2; }
.g-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.g-item:hover img, .g-item:focus-visible img { transform: scale(1.04); }

/* Visor de fotos */
.lightbox {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    border: 0;
    padding: 56px 72px;
    background: rgba(18, 21, 48, .95);
    color: #fff;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(18, 21, 48, .6); }
.lightbox figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 100%;
    max-height: 100%;
}
.lightbox img {
    max-width: 100%;
    max-height: calc(100vh - 160px);
    width: auto;
    border-radius: 10px;
}
.lightbox figcaption { font-weight: 600; font-size: 1.1rem; }
.lb-btn {
    position: absolute;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
    font-size: 1.4rem;
}
.lb-btn:hover { background: rgba(255, 255, 255, .25); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ---------- Contacte ---------- */
.contact { background: var(--navy); color: #fff; }
.contact h2 { color: #fff; }

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: clamp(32px, 5vw, 72px);
    align-items: stretch;
}
.contact-lead { color: #CBD0F0; font-size: 1.15rem; max-width: 40ch; margin-bottom: 1.75rem; }

.contact-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 2rem; }
.contact-buttons .btn { flex: 1 1 0; }
.contact-buttons .btn-accent { flex-basis: 100%; }

.contact-list li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, .15);
}
.contact-list .ico { color: var(--orange); }
.contact-list a { text-decoration: none; overflow-wrap: anywhere; }
.contact-list a:hover { text-decoration: underline; text-underline-offset: 3px; }

.map {
    min-height: 360px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--navy-deep);
    border: 1px solid rgba(255, 255, 255, .15);
}
.map iframe { display: block; width: 100%; height: 100%; min-height: 360px; border: 0; }
.map-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    padding: 32px 24px;
}
.map-pin { width: 44px; height: 44px; fill: none; stroke: var(--orange); stroke-width: 1.8; }
.map-address { font-size: 1.3rem; font-weight: 700; }
.map-note { color: #AEB4DD; font-size: .95rem; max-width: 40ch; }
.map-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }

/* ---------- Peu ---------- */
.site-footer {
    background: var(--navy-deep);
    color: #C6CAEA;
    padding: 48px 0 32px;
    font-size: .95rem;
}
.footer-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.footer-name { color: #fff; font-weight: 700; font-size: 1.25rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { color: #fff; }
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    padding-top: 20px;
}
.footer-disclaimer { margin-top: 16px; font-size: .8rem; color: #8E94C4; max-width: 90ch; }

/* WhatsApp flotant (mòbil) */
.wa-float {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 900;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    place-items: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.wa-float .ico { width: 28px; height: 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .about-grid, .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    :root { --header-h: 66px; }
    .brand img { height: 42px; }

    .hamburger { display: flex; }
    .hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    .nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--line);
        box-shadow: 0 16px 32px rgba(32, 36, 74, .12);
        padding: 8px 24px 20px;
        display: none;
    }
    .nav.open { display: block; }
    .nav ul { flex-direction: column; gap: 0; }
    .nav a { display: block; padding: 14px 0; font-size: 1.2rem; border-bottom: 1px solid var(--tile); background: none; }

    .hero-grid { grid-template-columns: 1fr; }
    .hero-photo { order: -1; margin: 24px 0 8px 24px; }
    .lead { max-width: none; }

    .wa-float { display: grid; }
}

@media (max-width: 700px) {
    .services-grid { grid-template-columns: 1fr; }
    .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; }
    .g-big { grid-column: span 2; grid-row: span 2; }
    .hero-actions { display: grid; }
    .contact-buttons .btn-accent { flex: 1 1 100%; }
    .hero-phones .btn, .contact-buttons .btn-light { flex: 1 1 0; padding-left: 12px; padding-right: 12px; white-space: nowrap; }
    .lightbox { padding: 64px 12px; }
    .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
    .lb-prev { left: calc(50% - 60px); }
    .lb-next { right: calc(50% - 60px); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}
