/* Casal Català d'Irlanda — public site styles. No external fonts (privacy + speed). */
:root {
  --red: #c8102e;
  --red-dark: #9e0c24;
  --yellow: #fcd116;
  --yellow-soft: #fff4c2;
  --ink: #1f1a17;
  --ink-soft: #4a423c;
  --muted: #6f655d;
  --paper: #fffdf8;
  --tint: #f6f0e4;
  --line: #e7ddcc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 26, 23, .06), 0 8px 24px rgba(31, 26, 23, .06);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --wrap: 1120px;
  --wrap-narrow: 720px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0;
  font: 400 1.0625rem/1.65 var(--font-sans);
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red-dark); text-underline-offset: .18em; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-serif); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.wrap-narrow { max-width: var(--wrap-narrow); margin-left: auto; margin-right: auto; padding: 0 1.25rem; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 8px;
}
.skip-link:focus { top: 1rem; color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 253, 248, .94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header::before {
  content: ""; display: block; height: 5px;
  background: repeating-linear-gradient(90deg, var(--yellow) 0 22px, var(--red) 22px 44px);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 72px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { border-radius: 10px; }
.brand-text { font-family: var(--font-serif); font-weight: 700; font-size: 1.15rem; line-height: 1.05; }
.brand-text span { display: block; font-weight: 400; font-size: .95rem; color: var(--muted); }

.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.nav-list, .lang-switch { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.nav-list { gap: .15rem; }
.nav-list a {
  display: block; padding: .5rem .7rem; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: .98rem;
}
.nav-list a:hover { background: var(--tint); color: var(--ink); }
.nav-list a[aria-current="page"] { background: var(--yellow-soft); }
.nav-list .nav-cta { background: var(--red); color: #fff; margin-left: .35rem; }
.nav-list .nav-cta:hover, .nav-list .nav-cta[aria-current="page"] { background: var(--red-dark); color: #fff; }

.lang-switch { gap: .1rem; font-size: .85rem; border-left: 1px solid var(--line); padding-left: 1rem; }
.lang-switch a { padding: .3rem .45rem; color: var(--muted); text-decoration: none; border-radius: 6px; font-weight: 600; }
.lang-switch a:hover { color: var(--ink); background: var(--tint); }
.lang-switch a[aria-current="true"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }

.menu-button {
  display: none; align-items: center; gap: .5rem;
  font: inherit; font-weight: 600; color: var(--ink);
  background: none; border: 1px solid var(--line); border-radius: 999px; padding: .45rem .9rem; cursor: pointer;
}
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative;
}
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }

@media (max-width: 960px) {
  .js .menu-button { display: inline-flex; }
  .site-nav { flex-direction: column; align-items: stretch; gap: .75rem; }
  .js .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 1rem 1.25rem 1.5rem; box-shadow: var(--shadow);
  }
  .js .site-nav.is-open { display: flex; }
  .header-inner { flex-wrap: wrap; position: relative; }
  html:not(.js) .site-nav { width: 100%; padding-bottom: 1rem; }
  .nav-list { flex-direction: column; align-items: stretch; }
  .nav-list a { padding: .75rem 1rem; font-size: 1.05rem; }
  .nav-list .nav-cta { margin: .5rem 0 0; text-align: center; }
  .lang-switch { border-left: 0; padding-left: 0; justify-content: center; gap: .5rem; font-size: 1rem; }
}

/* ---------- Buttons ---------- */
.button {
  display: inline-block; padding: .8rem 1.4rem; border-radius: 999px;
  font-weight: 650; text-decoration: none; line-height: 1.2; border: 2px solid transparent;
  transition: transform .15s ease, background-color .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--red); color: #fff; }
.button-primary:hover { background: var(--red-dark); color: #fff; }
.button-ghost { border-color: var(--ink); color: var(--ink); }
.button-ghost:hover { background: var(--ink); color: #fff; }
.button-light { background: #fff; color: var(--ink); }
.button-light:hover { background: var(--yellow); color: var(--ink); }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0; background: linear-gradient(180deg, var(--yellow-soft), var(--paper)); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: center; }
.hero h1 { max-width: 15ch; }
.lead { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--ink-soft); max-width: 40ch; }
.hero-art {
  aspect-ratio: 1; border-radius: 28px; background: var(--yellow);
  display: grid; grid-template-rows: repeat(9, 1fr); padding: 0; overflow: hidden;
  transform: rotate(-4deg); box-shadow: 0 20px 50px rgba(200, 16, 46, .18);
}
.hero-art span { background: var(--red); }
.hero-art span:nth-child(1) { grid-row: 2; }
.hero-art span:nth-child(2) { grid-row: 4; }
.hero-art span:nth-child(3) { grid-row: 6; }
.hero-art span:nth-child(4) { grid-row: 8; }
@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.section-tint { background: var(--tint); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.section-head h2 { margin: 0; }
.link-arrow { font-weight: 600; text-decoration: none; }
.link-arrow::after { content: " →"; }
.empty { color: var(--muted); font-style: italic; }
.page-head { padding: clamp(2rem, 5vw, 3.25rem) 0 0; }
.page-head h1 { margin: 0; }

/* ---------- News cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.card {
  background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(31,26,23,.06), 0 16px 36px rgba(31,26,23,.1); }
.card-media { display: block; aspect-ratio: 16 / 10; background: var(--tint); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.placeholder {
  display: block; width: 100%; height: 100%;
  background: repeating-linear-gradient(0deg, var(--yellow) 0 18%, var(--red) 18% 22%);
  opacity: .85;
}
.card-body { padding: 1.1rem 1.25rem 1.4rem; }
.card-date { display: block; font-size: .85rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .35rem; }
.card-title { margin: 0 0 .5rem; font-size: 1.2rem; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a::after { content: ""; }
.card-title a:hover { color: var(--red); }
.card-text { margin: 0; color: var(--ink-soft); font-size: .98rem; }

/* ---------- Events ---------- */
.event-list { display: grid; gap: .9rem; }
.event-row {
  display: flex; gap: 1.1rem; align-items: center;
  background: #fff; border-radius: var(--radius); padding: .9rem 1.1rem; box-shadow: var(--shadow);
}
.event-row.is-past { opacity: .75; }
.date-badge {
  flex: 0 0 auto; width: 64px; height: 64px; border-radius: 12px; text-decoration: none;
  background: var(--red); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.is-past .date-badge { background: var(--ink-soft); }
.date-day { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 700; }
.date-month { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; margin-top: .2rem; }
.event-title { margin: 0 0 .2rem; font-size: 1.15rem; }
.event-title a { color: var(--ink); text-decoration: none; }
.event-title a:hover { color: var(--red); }
.event-meta { margin: 0; color: var(--muted); font-size: .95rem; display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.event-location::before { content: "📍 "; }

/* ---------- Groups & panels ---------- */
.group-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.group-card {
  display: block; padding: 1.75rem; border-radius: var(--radius); text-decoration: none; color: var(--ink);
  border: 2px solid var(--line); transition: border-color .2s ease, transform .2s ease;
}
.group-card:hover { border-color: var(--red); color: var(--ink); transform: translateY(-2px); }
.group-card h3 { margin-bottom: .3rem; }
.group-card p { margin: 0; color: var(--ink-soft); }
.group-card h3::after { content: " →"; color: var(--red); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.panel { border-radius: calc(var(--radius) + 6px); padding: clamp(1.75rem, 4vw, 2.5rem); color: #fff; }
.panel p:last-child { margin-bottom: 0; }
.panel-red { background: var(--red); }
.panel-ink { background: var(--ink); }

/* ---------- Articles & pages ---------- */
.article { padding: clamp(2rem, 5vw, 3.5rem) 0 4rem; }
.article-head { margin-bottom: 1.75rem; }
.article-head h1 { margin-top: .35rem; }
.link-back { display: inline-block; margin-bottom: 1.25rem; font-weight: 600; text-decoration: none; font-size: .95rem; }
.article-image { margin-top: 0; margin-bottom: 2rem; }
.article-image img { width: 100%; border-radius: var(--radius); }
.prose { font-size: 1.1rem; }
.prose h2 { margin-top: 1.8em; font-size: 1.6rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: .35em; }
.prose .lead { font-size: 1.25rem; }
.page-prose h1 { margin-bottom: .75em; }
.lang-note {
  font-size: .92rem; color: var(--ink-soft); background: var(--yellow-soft);
  border-radius: 8px; padding: .55rem .85rem; display: inline-block;
}
.todo {
  background: #fff1f1; border-left: 4px solid var(--red); padding: .6rem .9rem; border-radius: 6px;
  font-size: .95rem; color: var(--red-dark);
}
.event-facts { display: grid; gap: .4rem; margin: 1rem 0 0; }
.event-facts div { display: flex; gap: .75rem; }
.event-facts dt { font-weight: 700; min-width: 5.5rem; }
.event-facts dd { margin: 0; }
.contact-list { list-style: none; padding: 0 !important; }
.contact-list li { padding: .85rem 0; border-bottom: 1px solid var(--line); }

.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 2.5rem; gap: 1rem; }
.pager a { font-weight: 600; text-decoration: none; }
.pager a[rel="next"] { justify-self: end; }
.pager-count { color: var(--muted); font-size: .95rem; }

.not-found { text-align: center; padding: 2rem 1.25rem; }
.big-number { font-family: var(--font-serif); font-size: 6rem; line-height: 1; color: var(--red); margin: 0 0 .5rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #e9e2d8; padding-top: 3rem; margin-top: 0; }
.site-footer a { color: #fff; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding-bottom: 2rem; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-brand { display: flex; gap: 1rem; align-items: flex-start; }
.footer-brand img { border-radius: 9px; flex: 0 0 auto; }
.footer-heading { font-family: var(--font-sans); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: #b9aea2; margin-bottom: .6rem; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: .3rem; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.1rem; padding-bottom: 1.4rem; font-size: .9rem; color: #b9aea2;
}
.flag-stripes { width: 60px; height: 14px; border-radius: 3px; background: repeating-linear-gradient(0deg, var(--yellow) 0 2px, var(--red) 2px 3.5px); }

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

/* ---------- v1.1: calendar, page photos ---------- */
.calendar-box {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 2rem;
  background: var(--yellow-soft); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 2.5rem;
}
.calendar-box p { margin: 0; max-width: 46ch; color: var(--ink-soft); }
.calendar-box .button-row { margin: 0; }
.calendar-title { font-size: 1.3rem; margin: 0 0 .3rem; }
.calendar-add { margin-top: 1.5rem; }
.button-row .button { font-size: .95rem; }
.page-photo { margin: 1.75rem 0; }
.page-photo img { width: 100%; border-radius: var(--radius); }
.page-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; margin-top: 2rem; }
.page-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; transition: opacity .2s; }
.page-gallery a:hover img { opacity: .85; }
.page-button { margin: 1.5rem 0; }
