:root {
  --ink: #12282b;
  --muted: #5a6a6c;
  --paper: #fffaf2;
  --shell: #f6ead8;
  --mist: #e7f3f1;
  --sea: #0b6f78;
  --sea-dark: #083f46;
  --pine: #2f6d58;
  --coral: #c95d45;
  --gold: #d99c24;
  --white: #ffffff;
  --line: rgba(18, 40, 43, 0.14);
  --shadow: 0 18px 50px rgba(18, 40, 43, 0.16);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

img,
svg {
  display: block;
}

img {
  width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 20;
  padding: 0.7rem 1rem;
  transform: translateY(-140%);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--sea-dark);
  box-shadow: var(--shadow);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.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;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  color: var(--white);
  transition:
    background 180ms ease,
    border-color 180ms ease;
}

.site-header.scrolled,
.site-header.open {
  background: rgba(8, 63, 70, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(1180px, calc(100% - 2rem));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 50%;
  color: var(--sea-dark);
  background: var(--white);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.02rem;
  line-height: 1.1;
}

.brand small {
  margin-top: 0.1rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.main-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.93rem;
  font-weight: 650;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--white);
  background: rgba(255, 255, 255, 0.11);
  outline: none;
}

.main-nav .nav-cta {
  margin-left: 0.4rem;
  color: var(--sea-dark);
  background: var(--white);
}

.main-nav .nav-cta:hover,
.main-nav .nav-cta:focus-visible {
  color: var(--sea-dark);
  background: var(--shell);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.menu-toggle-lines,
.menu-toggle-lines::before,
.menu-toggle-lines::after {
  display: block;
  width: 20px;
  height: 2px;
  margin: auto;
  background: currentColor;
  content: "";
  transition: transform 160ms ease;
}

.menu-toggle-lines::before {
  transform: translateY(-7px);
}

.menu-toggle-lines::after {
  transform: translateY(5px);
}

.site-header.open .menu-toggle-lines {
  transform: rotate(45deg);
}

.site-header.open .menu-toggle-lines::before {
  transform: translateY(0) rotate(90deg);
}

.site-header.open .menu-toggle-lines::after {
  transform: translateY(-2px) rotate(90deg);
}

.hero {
  position: relative;
  min-height: clamp(610px, 82svh, 760px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: var(--white);
  background: var(--sea-dark);
}

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

.hero-media {
  background-image: url("https://commons.wikimedia.org/wiki/Special:FilePath/Torredembarra-pamorama.jpg?width=1800");
  background-position: center;
  background-size: cover;
  transform: scale(1.02);
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(5, 26, 30, 0.85) 0%, rgba(5, 26, 30, 0.58) 44%, rgba(5, 26, 30, 0.12) 100%),
    linear-gradient(0deg, rgba(5, 26, 30, 0.75) 0%, rgba(5, 26, 30, 0.08) 48%, rgba(5, 26, 30, 0.48) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 9.5rem 0 5.5rem;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: var(--coral);
}

.hero h1 {
  max-width: 980px;
  margin: 0;
  font-size: clamp(3.8rem, 8vw, 7.8rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 690px;
  margin: 1.35rem 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.05rem, 2vw, 1.32rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.8rem;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.78rem 1rem;
  border: 0;
  border-radius: var(--radius);
  font-weight: 780;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.button svg {
  width: 1.08rem;
  height: 1.08rem;
  fill: currentColor;
  flex: 0 0 auto;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.button.primary {
  color: var(--sea-dark);
  background: var(--white);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--shell);
}

.button.secondary {
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.56);
  background: rgba(255, 255, 255, 0.12);
}

.button.secondary:hover,
.button.secondary:focus-visible {
  background: rgba(255, 255, 255, 0.2);
}

.quick-strip {
  width: min(1180px, calc(100% - 2rem));
  margin: -2.1rem auto 0;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.quick-strip a {
  min-height: 106px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.22rem;
  border-right: 1px solid var(--line);
}

.quick-strip a:last-child {
  border-right: 0;
}

.quick-strip a:hover,
.quick-strip a:focus-visible {
  background: var(--mist);
  outline: none;
}

.quick-strip span {
  color: var(--coral);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-strip strong {
  font-size: clamp(1rem, 2vw, 1.24rem);
}

.section {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 5.5rem 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 2rem;
}

.section-heading h2,
.agenda-copy h2,
.community-main h2,
.newsletter h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1;
  letter-spacing: 0;
}

.section-heading p,
.agenda-copy p,
.community-main p,
.newsletter p {
  max-width: 680px;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.03rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.filter-button {
  min-height: 38px;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--white);
  font-weight: 740;
  cursor: pointer;
}

.filter-button.active,
.filter-button:hover,
.filter-button:focus-visible {
  color: var(--white);
  background: var(--sea);
  border-color: var(--sea);
  outline: none;
}

.news-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.35fr);
  gap: 1rem;
}

.feature-article,
.article-card,
.place-card,
.event-card,
.notice-board article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.feature-article {
  min-height: 100%;
  padding: clamp(1.25rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(0deg, rgba(8, 63, 70, 0.82), rgba(8, 63, 70, 0.44)),
    url("https://commons.wikimedia.org/wiki/Special:FilePath/Torredembarra-pamorama.jpg?width=1200") center/cover;
  color: var(--white);
  overflow: hidden;
}

.feature-article h3 {
  max-width: 560px;
  margin: 1rem 0 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.feature-article p {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.02rem;
}

.feature-article a {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 2rem;
  font-weight: 800;
}

.feature-article a svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

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

.article-card {
  min-height: 224px;
  padding: 1.15rem;
  display: grid;
  align-content: start;
  gap: 0.7rem;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.article-card.hidden {
  display: none;
}

.article-card:hover {
  transform: translateY(-2px);
}

.article-card h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.14;
}

.article-card p {
  margin: 0;
  color: var(--muted);
}

.date {
  width: fit-content;
  color: var(--sea);
  font-weight: 850;
}

.tag {
  width: fit-content;
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0.28rem 0.52rem;
  border-radius: 999px;
  color: var(--sea-dark);
  background: var(--mist);
  font-size: 0.76rem;
  font-weight: 850;
}

.tag.coral {
  color: #6b2318;
  background: #f7ddd6;
}

.tag.green {
  color: #174633;
  background: #dff0e8;
}

.tag.gold {
  color: #694510;
  background: #f8e7bd;
}

.section-tourism {
  padding-top: 1rem;
}

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

.place-card {
  overflow: hidden;
}

.place-card.wide {
  grid-column: span 2;
}

.place-card img {
  height: 285px;
  object-fit: cover;
}

.place-card-body {
  padding: 1rem;
}

.place-card h3 {
  margin: 0.7rem 0 0;
  font-size: 1.35rem;
}

.place-card p {
  margin: 0.55rem 0 0;
  color: var(--muted);
}

.agenda-band {
  width: 100%;
  max-width: none;
  padding: 5rem max(1rem, calc((100% - 1180px) / 2));
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 2rem;
  background: var(--mist);
}

.agenda-list {
  display: grid;
  gap: 0.8rem;
}

.event-card {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
}

.event-card time {
  display: grid;
  min-height: 72px;
  place-items: center;
  border-radius: var(--radius);
  color: var(--white);
  background: var(--coral);
}

.event-card time strong {
  font-size: 1.7rem;
  line-height: 1;
}

.event-card time span {
  margin-top: -0.6rem;
  font-weight: 800;
}

.event-card h3,
.notice-board h3 {
  margin: 0;
  font-size: 1.18rem;
}

.event-card p,
.notice-board p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.community {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 2rem;
  align-items: start;
}

.notice-board {
  display: grid;
  gap: 0.8rem;
}

.notice-board article {
  padding: 1rem;
}

.notice-board span {
  color: var(--sea);
  font-size: 0.76rem;
  font-weight: 860;
  text-transform: uppercase;
}

.newsletter {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 5rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.62fr);
  gap: 1.5rem;
  align-items: center;
  border-radius: var(--radius);
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(8, 63, 70, 0.95), rgba(11, 111, 120, 0.78)),
    url("https://commons.wikimedia.org/wiki/Special:FilePath/Far%20de%20Torredembarra%20-%20Tarragona.png?width=1400") center/cover;
  overflow: hidden;
}

.newsletter p {
  color: rgba(255, 255, 255, 0.78);
}

.newsletter-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
}

.newsletter-form input {
  min-width: 0;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius);
  padding: 0 0.9rem;
  color: var(--white);
  background: rgba(255, 255, 255, 0.13);
}

.newsletter-form input::placeholder {
  color: rgba(255, 255, 255, 0.68);
}

.newsletter-form input:focus {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.form-message {
  grid-column: 1 / -1;
  min-height: 1.5rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.92rem;
}

.site-footer {
  padding: 2rem max(1rem, calc((100% - 1180px) / 2));
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  color: rgba(255, 255, 255, 0.76);
  background: #102f33;
}

.site-footer strong {
  display: block;
  color: var(--white);
}

.site-footer p {
  max-width: 460px;
  margin: 0.35rem 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-content: start;
  justify-content: flex-end;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.86);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--white);
  outline: none;
}

@media (max-width: 920px) {
  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .main-nav {
    position: absolute;
    inset: 76px 1rem auto 1rem;
    display: none;
    padding: 0.7rem;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius);
    background: rgba(8, 63, 70, 0.98);
    box-shadow: var(--shadow);
  }

  .site-header.open .main-nav {
    display: flex;
  }

  .main-nav a,
  .main-nav .nav-cta {
    margin-left: 0;
    justify-content: center;
  }

  .quick-strip,
  .news-layout,
  .agenda-band,
  .community,
  .newsletter {
    grid-template-columns: 1fr;
  }

  .quick-strip a {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .quick-strip a:last-child {
    border-bottom: 0;
  }

  .feature-article {
    min-height: 380px;
  }

  .places-grid {
    grid-template-columns: 1fr 1fr;
  }

  .place-card.wide {
    grid-column: span 2;
  }

  .newsletter-form {
    max-width: 620px;
  }
}

@media (max-width: 640px) {
  .header-inner {
    width: min(100% - 1rem, 1180px);
    min-height: 68px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand strong {
    font-size: 0.95rem;
  }

  .brand small {
    display: none;
  }

  .main-nav {
    inset: 68px 0.5rem auto 0.5rem;
  }

  .hero {
    min-height: 620px;
  }

  .hero-media {
    background-position: 56% center;
  }

  .hero-overlay {
    background:
      linear-gradient(90deg, rgba(5, 26, 30, 0.88), rgba(5, 26, 30, 0.48)),
      linear-gradient(0deg, rgba(5, 26, 30, 0.86), rgba(5, 26, 30, 0.06) 52%, rgba(5, 26, 30, 0.5));
  }

  .hero-content {
    width: min(100% - 1.25rem, 1180px);
    padding: 7rem 0 4.2rem;
  }

  .hero h1 {
    font-size: clamp(3rem, 17vw, 4.3rem);
    overflow-wrap: anywhere;
  }

  .hero-copy {
    font-size: 1rem;
  }

  .hero-actions,
  .newsletter-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .quick-strip,
  .section,
  .newsletter {
    width: min(100% - 1rem, 1180px);
  }

  .quick-strip {
    margin-top: -1.2rem;
  }

  .section {
    padding: 4.2rem 0;
  }

  .article-grid,
  .places-grid {
    grid-template-columns: 1fr;
  }

  .place-card.wide {
    grid-column: auto;
  }

  .place-card img {
    height: 230px;
  }

  .agenda-band {
    padding: 4rem 0.75rem;
  }

  .event-card {
    grid-template-columns: 64px 1fr;
    gap: 0.8rem;
    padding: 0.8rem;
  }

  .event-card time {
    min-height: 64px;
  }

  .newsletter {
    margin-bottom: 3.5rem;
  }

  .site-footer {
    display: grid;
    padding: 1.5rem 1rem;
  }

  .footer-links {
    justify-content: start;
  }
}

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