:root {
    --bg: #fffaf4;
    --ink: #1d1b18;
    --muted: #625c52;
    --brand: #138f7a;
    --brand-dark: #0b5d52;
    --accent: #ffce5c;
    --rose: #ff7b74;
    --card: #ffffff;
    --border: #eadfce;
    --shadow: 0 22px 70px rgba(37, 30, 22, 0.12);
    font-family: Karla, Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: radial-gradient(circle at top left, #fff0b8 0, transparent 34rem), var(--bg);
    font-size: 17px;
    line-height: 1.65;
}
a { color: var(--brand-dark); text-underline-offset: 0.18em; }
a:hover { color: #8b2f2a; }
img { max-width: 100%; height: auto; border-radius: 1.25rem; }
iframe { width: 100%; min-height: 22rem; border: 0; border-radius: 1.25rem; }

.skip-link {
    position: absolute;
    left: 1rem;
    top: -5rem;
    z-index: 100;
    padding: 0.75rem 1rem;
    background: var(--ink);
    color: #fff;
    border-radius: 0.5rem;
}
.skip-link:focus { top: 1rem; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255, 250, 244, 0.94); backdrop-filter: blur(18px); border-bottom: 1px solid var(--border); }
.frontend-admin-bar { position: fixed; top: 1rem; right: 1rem; z-index: 50; display: flex; gap: 0.5rem; }
.frontend-admin-bar a, .frontend-admin-bar button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.5rem; padding: 0.55rem 0.85rem; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: inherit; font-size: 0.9rem; font-weight: 900; text-decoration: none; box-shadow: 0 10px 30px rgba(29, 27, 24, 0.22); cursor: pointer; }
.frontend-admin-bar a:hover, .frontend-admin-bar button:hover { background: var(--brand-dark); color: #fff; }
.frontend-admin-bar button:disabled { opacity: 0.55; cursor: not-allowed; }
.inline-edit-actions { position: fixed; right: 1rem; bottom: 1rem; z-index: 60; display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem; border: 1px solid var(--border); border-radius: 999px; background: rgba(255, 255, 255, 0.96); box-shadow: var(--shadow); }
.inline-edit-actions span { padding: 0 0.4rem; color: var(--muted); font-weight: 900; font-size: 0.9rem; }
.inline-edit-actions button { border: 0; border-radius: 999px; padding: 0.7rem 1rem; background: var(--ink); color: #fff; font: inherit; font-weight: 900; cursor: pointer; }
.inline-edit-actions button:last-child { background: #fff; color: var(--ink); border: 1px solid var(--border); }
.inline-editing [data-inline-field] { outline: 3px solid rgba(19, 143, 122, 0.35); outline-offset: 8px; }
.inline-editing [data-inline-field]:focus { outline: 3px solid var(--brand); outline-offset: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.6); }
.inline-editing .inline-active { border-bottom: 2px dashed var(--brand); transition: border-color 0.2s; cursor: text; }
.inline-editing .inline-active:hover { border-bottom-color: var(--accent); }
.inline-editing .inline-active:focus { border-bottom-style: solid; }
.inline-editing .ql-toolbar.ql-snow { position: sticky; top: 5.5rem; z-index: 20; border-radius: 1rem 1rem 0 0; background: #fff; border-color: var(--border); }
.inline-editing .ql-container.ql-snow { border-color: var(--border); border-radius: 0 0 1rem 1rem; background: #fff; }
.inline-editing .ql-editor { min-height: 280px; font-size: 1.05rem; line-height: 1.65; }
.topbar { display: flex; align-items: center; justify-content: center; gap: 1.4rem; min-height: 2.05rem; padding: 0.38rem 1rem; color: var(--muted); font-size: 0.78rem; line-height: 1; }
.topbar > span:first-child::after { content: "·"; margin-left: 1.4rem; opacity: 0.55; }
.nav { position: relative; display: grid; grid-template-columns: minmax(155px, 1fr) auto minmax(155px, 1fr); align-items: center; gap: clamp(1rem, 2.25vw, 2.5rem); max-width: 1360px; margin: 0 auto; padding: 0.8rem clamp(1rem, 3vw, 2.5rem); }
.brand { display: inline-flex; align-items: center; justify-self: start; color: var(--ink); font-weight: 900; text-decoration: none; }
.brand-logo { display: block; width: auto; height: 3.8rem; max-width: 14.5rem; object-fit: contain; border-radius: 0; }
.menu { display: flex; align-items: center; justify-content: center; gap: clamp(0.1rem, 0.45vw, 0.55rem); padding: 0; margin: 0; list-style: none; }
.menu a { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0.6rem 0.8rem; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 750; white-space: nowrap; transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease; }
.menu a:hover, .menu a:focus-visible, .menu a.active { background: var(--accent); color: var(--ink); }
.nav-actions { display: inline-flex; align-items: center; justify-content: flex-end; justify-self: end; gap: 0.55rem; }
.account-menu-link { display: grid; place-items: center; flex: 0 0 auto; width: 2.75rem; height: 2.75rem; padding: 0.62rem; border: 1px solid var(--border); border-radius: 999px; background: rgba(255, 255, 255, 0.72); color: var(--ink); text-decoration: none; transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease; }
.account-menu-link:hover, .account-menu-link:focus-visible { background: var(--accent); color: var(--ink); transform: translateY(-1px); }
.account-menu-link svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.account-menu-link.is-authenticated { background: var(--brand); color: #fff; border-color: var(--brand); }
.menu-toggle { display: none; min-height: 2.75rem; }
.language-switcher { display: inline-flex; align-items: center; gap: 0.15rem; padding: 0.18rem; border: 1px solid var(--border); border-radius: 999px; background: rgba(255, 255, 255, 0.72); }
.language-switcher a { display: grid; place-items: center; min-width: 2.35rem; min-height: 2.35rem; padding: 0.3rem; border-radius: 999px; color: var(--ink); font-size: 0.74rem; font-weight: 900; letter-spacing: 0.06em; text-decoration: none; transition: color .2s ease, background .2s ease; }
.language-switcher a:hover, .language-switcher a:focus-visible, .language-switcher a.active { background: var(--ink); color: #fff; }

.hero { padding: clamp(3rem, 7vw, 5.5rem) 1rem; background: linear-gradient(135deg, rgba(19, 143, 122, 0.12), rgba(255, 206, 92, 0.2)); }
.hero > div, .section, .footer { max-width: 1180px; margin: 0 auto; }
.hero-shell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; align-items: center; }
.hero-with-images .hero-shell { grid-template-columns: minmax(0, 0.95fr) minmax(340px, 0.75fr); }
.hero-copy { min-width: 0; }
.hero h1 { max-width: 920px; margin: 0 0 1rem; font-size: clamp(2.3rem, 5vw, 4.75rem); line-height: 1; letter-spacing: -0.055em; }
.hero p { max-width: 760px; font-size: clamp(1.05rem, 1.5vw, 1.3rem); color: var(--muted); }
.hero-home { min-height: 72vh; display: grid; align-items: center; background: radial-gradient(circle at 85% 25%, rgba(255, 123, 116, 0.25), transparent 18rem), linear-gradient(135deg, rgba(19, 143, 122, 0.14), rgba(255, 206, 92, 0.28)); }
.eyebrow { margin: 0 0 0.8rem; color: var(--brand-dark); font-weight: 900; letter-spacing: 0.11em; text-transform: uppercase; font-size: 0.82rem; }
.search { display: flex; gap: 0.5rem; max-width: 560px; margin-top: 2rem; }
.search input { flex: 1; min-width: 0; padding: 0.9rem 1rem; border: 2px solid var(--border); border-radius: 999px; font: inherit; }
.search button, .button { border: 0; border-radius: 999px; padding: 0.95rem 1.35rem; background: var(--ink); color: #fff; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.search button:hover, .button:hover { background: var(--brand-dark); color: #fff; }
.button-light { background: #fff; color: var(--ink); border: 1px solid var(--border); }
.button-light:hover { background: var(--accent); color: var(--ink); }
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.text-link { font-weight: 900; color: var(--brand-dark); }

.image-cluster { position: relative; min-height: 460px; }
.image-cluster img { position: absolute; object-fit: cover; box-shadow: var(--shadow); border: 8px solid rgba(255, 255, 255, 0.84); }
.image-cluster img:nth-child(1) { inset: 0 auto auto 16%; width: 70%; aspect-ratio: 16 / 10; transform: rotate(2deg); z-index: 2; }
.image-cluster img:nth-child(2) { right: 0; bottom: 0; width: 54%; aspect-ratio: 4 / 5; transform: rotate(-4deg); z-index: 3; }
.image-cluster img:nth-child(3) { left: 0; bottom: 8%; width: 46%; aspect-ratio: 1; transform: rotate(5deg); z-index: 1; }

.section { padding: clamp(3rem, 7vw, 6rem) 1rem; }
.narrow { max-width: 780px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.section h2 { margin: 0 0 1rem; font-size: clamp(1.8rem, 3vw, 3rem); line-height: 1.08; letter-spacing: -0.04em; }
.content { max-width: 980px; }
.section-tight { padding-top: 0; }
.content h2, .content h3 { line-height: 1.15; letter-spacing: -0.03em; }
.content h2 { font-size: clamp(1.65rem, 2.5vw, 2.45rem); margin-top: 3rem; }
.content h3 { font-size: clamp(1.25rem, 1.8vw, 1.7rem); }
.content ul { padding-left: 1.4rem; }
.content a[href*="jelentkezes"], .content a[href*="kiallitoi-informaciok"] { font-weight: 900; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.cards-featured { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards-listing { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 1.5rem; padding: 1.2rem; box-shadow: var(--shadow); overflow: hidden; }
.card-media { display: block; margin: -1.2rem -1.2rem 1rem; }
.card h3 { margin: 0.25rem 0 0.6rem; line-height: 1.15; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--brand-dark); text-decoration: underline; }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 1.2rem 1.2rem 0 0; }
.card-body { display: grid; gap: 0.35rem; }
.event-card { position: relative; background: linear-gradient(180deg, #fff, #fffaf4); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.event-card:hover { transform: translateY(-3px); box-shadow: 0 18px 42px rgba(46, 37, 31, 0.14); }
.event-card .event-card-link::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.event-card .event-card-link:focus-visible::after { outline: 3px solid var(--brand); outline-offset: -3px; border-radius: inherit; }
.meta { margin: 0; color: var(--brand-dark); font-weight: 900; font-size: 0.9rem; }

.intro-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.intro-grid h2 { margin-top: 0; }
.intro-copy { color: var(--muted); font-size: clamp(1.05rem, 1.5vw, 1.25rem); }
.feature-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding-top: 0; }
.feature-strip article { background: var(--ink); color: #fff; border-radius: 1.5rem; padding: clamp(1.25rem, 3vw, 2rem); min-height: 13rem; display: flex; flex-direction: column; justify-content: space-between; }
.feature-strip strong { display: block; font-size: clamp(1.35rem, 2.2vw, 2.05rem); line-height: 1.08; letter-spacing: -0.035em; }
.feature-strip span { color: rgba(255, 255, 255, 0.78); }
.image-story { padding-top: 2rem; }
.masonry-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.masonry-gallery figure { margin: 0; overflow: hidden; border-radius: 1.5rem; background: #fff; box-shadow: var(--shadow); }
.masonry-gallery img { width: 100%; height: 100%; min-height: 220px; object-fit: cover; display: block; transition: transform 0.35s ease; }
.masonry-gallery figure:nth-child(1), .masonry-gallery figure:nth-child(6) { grid-row: span 2; }
.masonry-gallery figure:nth-child(3) { grid-column: span 2; }
.masonry-gallery figure:hover img { transform: scale(1.04); }
.listing-header { padding-bottom: 2rem; }
.listing-header h2 { max-width: 850px; }
.listing-header p { max-width: 760px; color: var(--muted); font-size: 1.2rem; }
.listing-search { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; max-width: 760px; }
.listing-search input { flex: 1 1 280px; padding: 0.95rem 1rem; border: 2px solid var(--border); border-radius: 999px; font: inherit; }
.result-count { margin: 0 0 1rem; color: var(--muted); font-weight: 800; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 2rem; }
.pagination a { min-width: 2.75rem; min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; padding: 0.55rem 0.9rem; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--ink); font-weight: 900; text-decoration: none; }
.pagination a:hover, .pagination a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.section-accent { background: #fff0e9; max-width: none; padding-left: max(1rem, calc((100vw - 1180px) / 2)); padding-right: max(1rem, calc((100vw - 1180px) / 2)); }
.readable-content { background: #fff; border: 1px solid var(--border); border-radius: 2rem; padding: clamp(1.25rem, 4vw, 3rem); margin-bottom: clamp(3rem, 7vw, 6rem); box-shadow: var(--shadow); }
.readable-content > ul:first-child, .readable-content > p:first-child:empty { display: none; }
.cms-story { padding-top: 1rem; padding-bottom: clamp(2rem, 5vw, 4rem); }
.listing-story { padding-top: 0; }
.cms-content { max-width: 980px; margin-bottom: 0; }
.cms-content section > :first-child, .cms-content > :first-child { margin-top: 0; }
.cms-content section > :last-child, .cms-content > :last-child { margin-bottom: 0; }
.cms-content ol, .cms-content ul { display: grid; gap: 0.45rem; }
.detail-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 2rem; align-items: start; }
.detail-meta { position: sticky; top: 7rem; }
.detail-meta p { margin-top: 0; }
.detail-meta .button { width: 100%; }
.notice { padding: 1rem; background: #fff4d6; border: 1px solid #f0d48a; border-radius: 1rem; color: #5f4300; font-size: 0.95rem; }
.detail-content { min-width: 0; }
.detail-image { width: 100%; max-height: 560px; object-fit: cover; margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.lead { font-size: clamp(1.12rem, 1.6vw, 1.4rem); color: var(--muted); line-height: 1.45; margin: 0 0 1.5rem; }
.detail-readable { margin-bottom: 0; }
.event-single { padding-top: clamp(2.5rem, 6vw, 5rem) !important; }
.event-single-grid { display: grid; grid-template-columns: minmax(280px, 390px) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.event-single-aside { position: sticky; top: 1.5rem; }
.event-single-image { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 0.5rem 0.5rem 0 0; box-shadow: var(--shadow); }
.event-facts { padding: 1.5rem; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 0.5rem 0.5rem; background: #fff; box-shadow: var(--shadow); }
.event-facts section { padding-top: 1.15rem; margin-top: 1.15rem; border-top: 1px solid var(--border); }
.event-facts h2 { margin: 0 0 0.55rem; font-size: 1.1rem; letter-spacing: 0; }
.event-facts p { margin: 0; }
.event-facts ul, .event-date-groups ul { display: grid; gap: 0.3rem; margin: 0; padding: 0; list-style: none; }
.event-text-link, .event-back-link { display: inline-flex; margin-top: 0.65rem; color: var(--brand-dark); font-weight: 800; text-decoration: underline; text-underline-offset: 0.2em; }
.event-status { display: inline-flex; padding: 0.35rem 0.65rem; border-radius: 999px; font-size: 0.88rem; font-weight: 900; }
.event-status.is-open { color: #17633f; background: #daf3e6; }
.event-status.is-closed { color: #704a19; background: #fff0d4; }
.event-application-window { margin-top: 0.75rem !important; color: var(--muted); font-size: 0.92rem; }
.event-single-content > h2 { margin: 0 0 1.25rem; }
.event-single-content > p { max-width: 780px; color: var(--muted); line-height: 1.75; }
.event-single-lead { color: var(--ink) !important; font-size: clamp(1.15rem, 2vw, 1.4rem); font-weight: 600; line-height: 1.5 !important; }
.event-date-groups { margin-top: 2.5rem; }
.event-date-group-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.event-date-group-list article { padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: 0.75rem; background: #fff; }
.event-date-group-list h3 { margin: 0 0 0.55rem; font-size: 1rem; }
.event-single-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.5rem; }
.event-single-actions .button { min-width: 190px; }
.event-calendar-button::before { content: "＋"; margin-right: 0.35rem; font-weight: 900; }
.event-back-link { margin-top: 2rem; }
.app-bridge { min-height: 45vh; display: grid; place-items: center; }
.app-bridge-card { width: min(820px, 100%); background: #fff; border: 1px solid var(--border); border-radius: 2rem; padding: clamp(1.5rem, 5vw, 4rem); box-shadow: var(--shadow); }
.app-bridge-card h2 { margin-top: 0; }
.app-bridge-card p { max-width: 680px; color: var(--muted); font-size: 1.2rem; }
.not-found-page { min-height: 48vh; display: grid; place-items: center; }
.not-found-card { width: min(760px, 100%); background: #fff; border: 1px solid var(--border); border-radius: 2rem; padding: clamp(1.5rem, 5vw, 4rem); box-shadow: var(--shadow); text-align: center; }
.not-found-card h2 { margin-top: 0; }
.not-found-card .button-row { justify-content: center; }

.split { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 2rem; align-items: center; border-top: 1px solid var(--border); }
.split p:last-child { font-size: clamp(1.15rem, 2vw, 1.7rem); line-height: 1.35; color: var(--muted); }
.muted { background: #f0f7f4; max-width: none; padding-left: max(1rem, calc((100vw - 1180px) / 2)); padding-right: max(1rem, calc((100vw - 1180px) / 2)); }

.footer { padding: 4rem 1rem 2rem; border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 1.15fr 0.85fr 1fr; gap: 2rem; align-items: start; }
.footer h2 { margin: 0 0 0.5rem; font-size: clamp(1.8rem, 3vw, 3rem); letter-spacing: -0.04em; }
.footer h3 { margin: 0 0 1rem; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 2rem 0; }
.footer-grid .footer-links { margin: 0; }
.footer-links a { padding: 0.55rem 0.85rem; background: #fff; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; font-weight: 800; }
.copyright { color: var(--muted); font-size: 0.95rem; }

:focus-visible { outline: 4px solid var(--accent); outline-offset: 4px; }
@media (max-width: 1080px) {
    .nav { grid-template-columns: auto minmax(0, 1fr) auto; }
    .brand { grid-column: 1; }
    .menu-toggle { display: inline-flex; align-items: center; justify-content: center; justify-self: end; grid-column: 2; border: 1px solid var(--border); border-radius: 999px; background: #fff; padding: 0.65rem 1rem; font: inherit; font-weight: 800; cursor: pointer; }
    .nav-actions { grid-column: 3; }
    .menu { display: none; position: absolute; left: clamp(1rem, 3vw, 2.5rem); right: clamp(1rem, 3vw, 2.5rem); top: calc(100% + 0.45rem); z-index: 30; flex-direction: column; align-items: stretch; gap: 0.3rem; padding: 0.75rem; background: rgba(255,255,255,.98); border: 1px solid var(--border); border-radius: 1.25rem; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
    .menu.is-open { display: flex; }
    .menu a { width: 100%; justify-content: flex-start; padding-inline: 1rem; }
}
@media (max-width: 640px) {
    .topbar { gap: 0.65rem; padding-inline: 0.65rem; font-size: 0.64rem; letter-spacing: 0.08em; }
    .topbar > span:first-child::after { margin-left: 0.65rem; }
    .nav { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0.55rem; padding-block: 0.6rem; }
    .brand { grid-column: 1; }
    .menu-toggle { grid-column: 2; }
    .nav-actions { grid-column: 1 / -1; justify-self: stretch; justify-content: flex-end; }
    .menu { top: calc(100% + 0.35rem); }
    .brand-logo { height: 3.1rem; max-width: 10.5rem; }
}

@media (max-width: 900px) {
    body { font-size: 16px; }
    .topbar { flex-direction: column; align-items: center; gap: 0.15rem; }
    .menu-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; background: #fff; padding: 0.65rem 0.9rem; font: inherit; font-weight: 800; }
    .language-switcher { margin-left: auto; }
    .menu { display: none; position: absolute; left: 1rem; right: 1rem; top: 100%; flex-direction: column; align-items: stretch; padding: 1rem; background: #fff; border: 1px solid var(--border); border-radius: 1.25rem; box-shadow: var(--shadow); }
    .menu.is-open { display: flex; }
    .menu a { width: 100%; }
    .cards, .cards-featured, .cards-listing, .split, .intro-grid, .feature-strip, .detail-layout, .event-single-grid, .hero-with-images .hero-shell, .footer-grid { grid-template-columns: 1fr; }
    .section-heading { display: block; }
    .feature-strip article { min-height: auto; gap: 1.5rem; }
    .detail-meta { position: static; order: 2; }
    .event-single-aside { position: static; }
    .event-date-group-list { grid-template-columns: 1fr; }
    .image-cluster { min-height: 360px; max-width: 560px; }
    .masonry-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .masonry-gallery figure:nth-child(1), .masonry-gallery figure:nth-child(3), .masonry-gallery figure:nth-child(6) { grid-column: auto; grid-row: auto; }
}

@media (max-width: 560px) {
    .search { flex-direction: column; }
    .hero { padding-top: 3rem; }
    .image-cluster { min-height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
    .image-cluster img { position: static; width: 100% !important; aspect-ratio: 1; transform: none !important; border-width: 4px; }
    .image-cluster img:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
    .masonry-gallery { grid-template-columns: 1fr; }
}

mark { background: var(--accent); color: var(--ink); padding: 0.05em 0.15em; border-radius: 0.2em; }

.spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: -0.15em;
}
@keyframes spin { to { transform: rotate(360deg); } }

.inline-edit-actions .save-success {
    color: var(--brand);
    font-weight: 700;
}
.inline-edit-actions .save-done {
    background: var(--brand) !important;
    color: #fff !important;
}

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

/* Inline media and block editing */
.inline-editing [data-inline-field="image"] {
    cursor: pointer;
    outline: 4px solid rgba(19, 143, 122, .48);
    outline-offset: 5px;
}
.inline-editing [data-inline-field="image"]:hover { outline-color: var(--accent); filter: saturate(1.08) brightness(.92); }
.inline-editing [data-inline-background-setting] { outline: 4px dashed rgba(19, 143, 122, .55); outline-offset: -8px; position: relative; }
.inline-background-control { display: none; }
.inline-editing .inline-background-control { position: absolute; top: 1rem; left: 1rem; z-index: 35; display: inline-flex; align-items: center; justify-content: center; min-height: 2.5rem; padding: .55rem .85rem; border: 2px solid #fff; border-radius: 999px; background: var(--ink); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.2); font: 800 .8rem/1.2 "Segoe UI", sans-serif; cursor: pointer; }
.inline-block-tools,
.inline-gallery-toolbar,
.inline-gallery-controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.inline-block-tools,
.inline-gallery-toolbar {
    background: rgba(255,255,255,.97);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: 0 12px 36px rgba(23,40,36,.14);
    margin: 0 0 1rem;
    padding: .7rem;
    position: relative;
    z-index: 30;
}
.inline-block-tools strong,
.inline-gallery-toolbar strong { font-size: .86rem; margin-right: .25rem; }
.inline-block-tools button,
.inline-gallery-toolbar button,
.inline-gallery-controls button {
    background: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font: 800 .78rem/1.2 "Segoe UI", sans-serif;
    padding: .55rem .8rem;
}
.inline-block-tools button:hover,
.inline-gallery-toolbar button:hover,
.inline-gallery-controls button:hover { background: var(--brand); color: var(--ink); }
.inline-editing [data-inline-gallery-item] { overflow: visible; position: relative; }
.inline-gallery-controls {
    background: rgba(255,255,255,.96);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 8px 25px rgba(23,40,36,.18);
    left: .6rem;
    padding: .35rem;
    position: absolute;
    right: .6rem;
    top: .6rem;
    z-index: 25;
}
.inline-gallery-controls button { flex: 1 1 auto; padding: .42rem .6rem; }
.inline-gallery-controls .inline-remove-image { background: #8b2f3b; border-color: #8b2f3b; }
.inline-editing [data-inline-gallery] { outline: 3px dashed rgba(19,143,122,.4); outline-offset: 12px; }
.inline-editor-help { color: var(--muted); font-size: .78rem; margin-left: auto; }
@media (max-width: 720px) {
    .inline-editor-help { flex-basis: 100%; margin-left: 0; }
    .inline-gallery-controls { border-radius: .8rem; }
}
/* Accessibility preferences */
.a11y-tools { position: relative; flex: 0 0 auto; }
.a11y-tools-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; padding: .45rem; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-size: .78rem; font-weight: 900; cursor: pointer; }
.a11y-tools-toggle > span:first-child { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--ink); color: #fff; letter-spacing: -.05em; }
.a11y-tools-toggle:hover, .a11y-tools-toggle[aria-expanded="true"] { background: var(--accent); color: var(--ink); }
.a11y-tools-panel { position: absolute; top: calc(100% + .75rem); right: 0; z-index: 90; width: min(22rem, calc(100vw - 2rem)); padding: 1rem; border: 1px solid var(--border); border-radius: 1rem; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.a11y-tools-panel[hidden] { display: none; }
.a11y-tools-heading, .a11y-font-row { display: flex; align-items: center; gap: .5rem; }
.a11y-tools-heading { justify-content: space-between; margin-bottom: .8rem; font-size: 1.05rem; }
.a11y-tools-heading button, .a11y-font-row button { display: grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem; padding: .35rem; border: 1px solid var(--border); border-radius: .7rem; background: var(--bg); color: var(--ink); font: inherit; font-weight: 900; cursor: pointer; }
.a11y-font-row { display: grid; grid-template-columns: 1fr auto auto; padding-bottom: .65rem; border-bottom: 1px solid var(--border); }
.a11y-option, .a11y-reset { display: block; width: 100%; min-height: 2.75rem; margin-top: .45rem; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: .7rem; background: var(--bg); color: var(--ink); text-align: left; font: inherit; font-weight: 800; cursor: pointer; }
.a11y-option[aria-pressed="true"] { border-color: var(--brand-dark); background: var(--brand-dark); color: #fff; }
.a11y-reset { margin-top: .8rem; text-align: center; background: transparent; }
html[data-a11y-font="1"] { font-size: 112.5%; }
html[data-a11y-font="2"] { font-size: 125%; }
html[data-a11y-font="1"] body { font-size: 20.25px !important; }
html[data-a11y-font="2"] body { font-size: 22.5px !important; }
html.a11y-readable body, html.a11y-readable button, html.a11y-readable input, html.a11y-readable textarea, html.a11y-readable select, html.a11y-readable h1, html.a11y-readable h2, html.a11y-readable h3, html.a11y-readable h4 { font-family: Arial, Verdana, sans-serif !important; letter-spacing: .01em !important; }
html.a11y-links main a, html.a11y-links footer a { text-decoration: underline !important; text-decoration-thickness: .14em !important; }
html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
html.a11y-contrast { --bg: #000; --ink: #fff; --muted: #fff; --brand: #ffeb00; --brand-dark: #ffeb00; --accent: #00ffff; --rose: #ffeb00; --card: #000; --border: #fff; --shadow: none; }
html.a11y-contrast body, html.a11y-contrast .site-header, html.a11y-contrast .topbar, html.a11y-contrast main, html.a11y-contrast section, html.a11y-contrast footer, html.a11y-contrast article { background: #000 !important; color: #fff !important; background-image: none !important; }
html.a11y-contrast a { color: #ffeb00 !important; text-decoration: underline; }
html.a11y-contrast h1, html.a11y-contrast h2, html.a11y-contrast h3, html.a11y-contrast h4, html.a11y-contrast p, html.a11y-contrast li, html.a11y-contrast label, html.a11y-contrast strong, html.a11y-contrast small, html.a11y-contrast blockquote, html.a11y-contrast figcaption, html.a11y-contrast .eyebrow, html.a11y-contrast .meta { color: #fff !important; }
html.a11y-contrast button, html.a11y-contrast input, html.a11y-contrast select, html.a11y-contrast textarea { border: 2px solid #fff !important; background: #000 !important; color: #fff !important; }
html.a11y-contrast button:hover, html.a11y-contrast button:focus-visible, html.a11y-contrast [aria-pressed="true"] { background: #ffeb00 !important; color: #000 !important; outline-color: #00ffff !important; }
html.a11y-contrast img { outline: 2px solid #fff; }
@media (max-width: 900px) { .nav { flex-wrap: wrap; } .a11y-tools { order: 3; } .a11y-tools-panel { position: fixed; top: auto; right: 1rem; bottom: 1rem; } }
@media (max-width: 560px) { .brand-logo { height: 2.7rem; max-width: 9rem; } .language-switcher { margin-left: 0; } }
@media (max-width: 640px) {
    .topbar { flex-direction: row; flex-wrap: wrap; gap: .25rem .6rem; min-height: 2rem; padding: .42rem .65rem; text-align: center; }
    .topbar > span:first-child::after { margin-left: .6rem; }
    .nav { grid-template-columns: minmax(0,1fr) auto; row-gap: .55rem; padding: .58rem 1rem .7rem; }
    .brand { grid-column: 1; grid-row: 1; min-width: 0; }
    .menu-toggle { grid-column: 2; grid-row: 1; justify-self: end; }
    .nav-actions { grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0; margin: 0; justify-self: stretch; justify-content: center; gap: .5rem; }
    .nav-actions .language-switcher { margin-left: 0; }
    .brand-logo { height: 3.1rem; max-width: 10.5rem; }
}
.inline-link-control { display: none; }
.inline-editing .inline-link-control { display: inline-flex; align-items: center; justify-content: center; min-height: 2.5rem; margin: .35rem; padding: .45rem .7rem; border: 2px solid var(--brand); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-size: .8rem; font-weight: 900; cursor: pointer; box-shadow: 0 5px 18px rgba(0,0,0,.12); }
