/* ================================================================
   ILC · Propuesta visual estilo Consello da Cultura Galega
   Paleta: azul marino #1D3557 · bermellón #C1272D
           crema #F4F1E8 · blanco roto #FDFDFB
   Tipografía: Playfair Display (editorial) + Source Sans 3 (UI)
================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
  color: #1a1a1a;
  background: #fdfdfb;
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
address { font-style: normal; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ================================================================
   VARIABLES
================================================================ */
:root {
  --navy:       #1D3557;
  --navy-dark:  #122340;
  --red:        #C1272D;
  --red-dark:   #96151A;
  --cream:      #F4F1E8;
  --cream-dark: #EAE6D6;
  --white:      #FDFDFB;
  --border:     #DDD9CC;
  --text:       #1a1a1a;
  --text-mid:   #444444;
  --text-light: #777777;
  --serif:      'Playfair Display', 'Times New Roman', Georgia, serif;
  --sans:       'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
}

/* ================================================================
   BARRA SUPERIOR
================================================================ */
.topbar {
  background: var(--navy-dark);
  color: #fff;
  font-size: 0.76rem;
  padding: 0.5rem 0;
  font-family: var(--sans);
  letter-spacing: 0.03em;
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.topbar-inner span { color: rgba(255,255,255,0.6); }
.topbar-links a {
  color: rgba(255,255,255,0.8);
  margin-left: 1.4rem;
  transition: color 0.2s;
}
.topbar-links a:hover { color: #fff; }

/* ================================================================
   CABECERA
================================================================ */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand-mark {
  width: 54px;
  height: 54px;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}
.brand-text strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.brand-text span {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
}
.header-search {
  display: flex;
  border: 1.5px solid var(--border);
  overflow: hidden;
  transition: border-color 0.2s;
}
.header-search:focus-within { border-color: var(--navy); }
.search-input {
  border: none;
  background: var(--cream);
  padding: 0.55rem 0.9rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  min-width: 210px;
  outline: none;
  color: var(--text);
}
.search-btn {
  border: none;
  background: var(--navy);
  color: #fff;
  padding: 0 1.1rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.search-btn:hover { background: var(--navy-dark); }

/* ================================================================
   NAVEGACIÓN PRINCIPAL
================================================================ */
.main-nav {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(29,53,87,0.25);
}
.nav-list {
  display: flex;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
.nav-list li a {
  display: block;
  padding: 1rem 1.05rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.nav-list li a:hover {
  color: #fff;
  border-bottom-color: #fff;
}

/* ================================================================
   HERO
================================================================ */
.hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(460px, 65vh, 640px);
  display: flex;
  align-items: flex-end;
  background: var(--navy);
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55) saturate(0.8);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(29,53,87,0.05) 0%,
    rgba(29,53,87,0.35) 45%,
    rgba(29,53,87,0.88) 100%
  );
}
.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-bottom: 4rem;
  padding-top: 2rem;
  color: #fff;
}
.hero-tag {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.38rem 0.9rem;
  margin-bottom: 1.2rem;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 820px;
  margin-bottom: 1rem;
}
.hero-address {
  font-family: var(--sans);
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
}

/* ================================================================
   INTRO + NOTICIAS
================================================================ */
.intro-section { padding: 5rem 0 4rem; }
.intro-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 4rem;
  align-items: start;
}
@media (max-width: 900px) { .intro-grid { grid-template-columns: 1fr; gap: 3rem; } }

.intro-lead {
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 1.3rem;
  position: relative;
}
.drop-cap {
  float: left;
  font-family: var(--serif);
  font-size: 4rem;
  font-weight: 700;
  line-height: 0.82;
  padding: 0.2rem 0.6rem 0 0;
  color: var(--red);
}
.intro-text {
  font-size: 1rem;
  color: var(--text-mid);
  line-height: 1.75;
  margin-bottom: 1.8rem;
}
.text-link {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  border-bottom: 2px solid var(--navy);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.text-link:hover { color: var(--red); border-color: var(--red); }

/* Columna noticias */
.news-col { border-top: 2px solid var(--red); }
.col-title {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.news-item {
  display: block;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.news-item:last-of-type { border-bottom: none; }
.news-date {
  display: block;
  font-family: var(--sans);
  font-size: 0.69rem;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}
.news-item h4 {
  font-family: var(--serif);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  transition: color 0.2s;
}
.news-item:hover h4 { color: var(--red); }
.col-link {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  transition: color 0.2s;
}
.col-link:hover { color: var(--red); }

/* ================================================================
   BANDA DE CIFRAS
================================================================ */
.stats-strip {
  background: var(--navy);
  padding: 2.5rem 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  text-align: center;
}
@media (max-width: 700px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-num {
  display: block;
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat-num sup { font-size: 1.1rem; vertical-align: super; }
.stat-label {
  display: block;
  font-family: var(--sans);
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-top: 0.4rem;
}

/* ================================================================
   SECCIONES — BASE
================================================================ */
.section { padding: 5rem 0; }
.section-alt { background: var(--cream); }
.section-navy { background: var(--navy); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.section-head--light { border-bottom-color: rgba(255,255,255,0.15); }

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.section-title--light { color: #fff; }

.section-link {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  transition: opacity 0.2s;
}
.section-link:hover { opacity: 0.7; }

/* ================================================================
   ÁREAS DE ACTIVIDAD
================================================================ */
.areas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}
.area-card {
  background: var(--white);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}
.area-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(29,53,87,0.13);
}
.area-thumb {
  height: 200px;
  overflow: hidden;
}
.area-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.area-card:hover .area-thumb img { transform: scale(1.05); }
.area-body {
  padding: 1.4rem 1.5rem 1.7rem;
  border-top: 3px solid var(--navy);
}
.area-label {
  display: block;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.5rem;
}
.area-body h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.6rem;
  line-height: 1.3;
}
.area-body p {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.65;
}

/* ================================================================
   SEDES
================================================================ */
.sedes-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3.5rem;
  align-items: center;
}
@media (max-width: 900px) { .sedes-layout { grid-template-columns: 1fr; } }

.sedes-photo { position: relative; }
.sedes-photo img {
  width: 100%;
  height: 420px;
  object-fit: cover;
}
.photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(29,53,87,0.85);
  color: #fff;
  padding: 1rem 1.3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.photo-caption strong {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
}
.photo-caption span {
  font-size: 0.78rem;
  opacity: 0.75;
  letter-spacing: 0.04em;
}

.sedes-intro {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 1.8rem;
}
.sedes-list { border-top: 2px solid var(--navy); }
.sedes-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.3rem;
}
.sedes-list li:last-child { border-bottom: 2px solid var(--red); }
.sedes-list li strong {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--navy);
}
.sedes-list li span {
  font-size: 0.78rem;
  color: var(--text-light);
  letter-spacing: 0.04em;
}

/* ================================================================
   PUBLICACIONES
================================================================ */
.pubs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.5rem;
}
.pub-card {
  display: block;
  transition: transform 0.25s;
}
.pub-card:hover { transform: translateY(-5px); }
.pub-cover {
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.2rem;
  margin-bottom: 0.8rem;
  position: relative;
  overflow: hidden;
}
.pub-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.07) 0%, rgba(0,0,0,0.15) 100%);
}
.pub-cover::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--red);
}
.cover-1 { background: linear-gradient(145deg, #122340 0%, #1D3557 100%); }
.cover-2 { background: linear-gradient(145deg, #2c1a00 0%, #5a3500 100%); }
.cover-3 { background: linear-gradient(145deg, #1a2c00 0%, #3a5a00 100%); }
.cover-4 { background: linear-gradient(145deg, #1a001a 0%, #3d0a3d 100%); }
.cover-5 { background: linear-gradient(145deg, #001a2c 0%, #003a5a 100%); }

.pub-colec {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  position: relative;
  z-index: 1;
}
.pub-titulo {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
  color: #fff;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}
.pub-year {
  font-family: var(--sans);
  font-size: 0.68rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.08em;
  position: relative;
  z-index: 1;
}
.pub-info strong {
  display: block;
  font-family: var(--serif);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.2rem;
  line-height: 1.35;
}
.pub-info span {
  font-size: 0.78rem;
  color: var(--text-light);
}

/* ================================================================
   AGENDA
================================================================ */
.agenda-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}
.evento-card {
  display: flex;
  gap: 1.2rem;
  padding: 1.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--navy);
  transition: box-shadow 0.25s, transform 0.25s;
}
.evento-card:hover {
  box-shadow: 0 8px 24px rgba(29,53,87,0.1);
  transform: translateY(-3px);
}
.evento-date {
  text-align: center;
  min-width: 52px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding-right: 1.2rem;
}
.evento-date .day {
  display: block;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
}
.evento-date .month {
  display: block;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-top: 0.2rem;
}
.evento-tipo {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.4rem;
}
.evento-body h3 {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 0.4rem;
}
.evento-body p {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ================================================================
   SERVICIOS INSTITUCIONALES
================================================================ */
.servicios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.servicio-card {
  display: block;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.15);
  padding: 2rem;
  color: #fff;
  transition: background 0.25s, border-color 0.25s;
}
.servicio-card:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.35);
}
.servicio-icon {
  color: rgba(255,255,255,0.7);
  margin-bottom: 1.2rem;
}
.servicio-card h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.7rem;
  line-height: 1.3;
}
.servicio-card p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.65;
  margin-bottom: 1.3rem;
}
.servicio-link {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  border-bottom: 1px solid rgba(255,255,255,0.3);
  padding-bottom: 1px;
}

/* ================================================================
   FOOTER
================================================================ */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.6);
  font-size: 0.88rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 3rem;
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 500px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.3rem;
}
.footer-mark {
  width: 44px;
  height: 44px;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.footer-brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.footer-brand span {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}
.footer-addr {
  font-size: 0.84rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.85;
}
.footer-addr a { color: rgba(255,255,255,0.6); transition: color 0.2s; }
.footer-addr a:hover { color: #fff; }

.footer-col h5 {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul li a {
  font-size: 0.86rem;
  color: rgba(255,255,255,0.5);
  transition: color 0.2s;
}
.footer-col ul li a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 1.2rem 0;
}
.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.74rem;
  color: rgba(255,255,255,0.3);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 768px) {
  .hero-title { font-size: 2.2rem; }
  .main-nav .nav-list { overflow-x: auto; flex-wrap: nowrap; }
  .main-nav .nav-list li a { padding: 1rem 0.75rem; white-space: nowrap; }
  .areas-grid { grid-template-columns: 1fr 1fr; }
  .pubs-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .areas-grid { grid-template-columns: 1fr; }
  .pubs-grid { grid-template-columns: repeat(2, 1fr); }
  .agenda-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.9rem; }
}
