/* Málaga Workers Council — public website (v2, bolder redesign) */
:root {
  --ink: #16233d;
  --muted: #5d6b84;
  --line: #dde4ee;
  --paper: #ffffff;
  --wash: #f1f5fb;
  --navy: #0b2f6f;
  --navy-2: #123e8c;
  --blue: #2765b2;
  --soft-blue: #eaf2fe;

  /* per-section accent colors (bolder, more colorful) */
  --c-benefits: #0f9d8f;   /* teal */
  --c-benefits-wash: #e3f6f3;
  --c-convenio: #6d4bd1;   /* indigo/purple */
  --c-convenio-wash: #efeafc;
  --c-rif: #e0820a;        /* amber */
  --c-rif-wash: #fdf1de;
  --c-contact: #2765b2;    /* blue */
  --c-contact-wash: #eaf2fe;
  --c-news: #d6457a;       /* magenta */
  --c-news-wash: #fce7ef;

  --accent: var(--c-rif);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(16, 35, 61, 0.08);
  --shadow-sm: 0 3px 10px rgba(16, 35, 61, 0.06);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  color: var(--ink);
  background: var(--wash);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px; line-height: 1.6;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.15em; }
.icon-sm { width: 1.05em; height: 1.05em; }
.icon-chev { width: 0.8em; height: 0.8em; opacity: 0.7; }

.container { width: min(100%, 1140px); margin: 0 auto; padding: 0 24px; }

/* ============================ Header ============================ */
.site-header {
  background: #fff;
  border-bottom: 3px solid var(--navy);
  position: sticky; top: 0; z-index: 60;
  box-shadow: var(--shadow-sm);
}
.site-header-inner {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 24px; flex-wrap: nowrap;
}
.site-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); flex: 0 0 auto; }
.site-brand:hover { text-decoration: none; }
.site-brand-logo { width: auto; height: 80px; border-radius: 6px; }
.site-brand-text { display: grid; gap: 2px; line-height: 1.12; }
.site-brand-text strong { font-size: 17px; color: var(--navy); font-weight: 900; letter-spacing: -0.01em; white-space: nowrap; }
.site-brand-text small { font-size: 11.5px; color: var(--muted); }

.site-nav { flex: 1 1 auto; min-width: 0; }
.site-nav > ul {
  display: flex; gap: 2px; margin: 0; padding: 0; list-style: none;
  justify-content: flex-end; flex-wrap: nowrap;
}
.site-nav li { margin: 0; }  /* cancel global "li + li { margin-top }" in the horizontal bar */
.site-nav a {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 9px; border-radius: 9px; white-space: nowrap;
  color: var(--ink); font-size: 13.5px; font-weight: 700;
}
.site-nav a:hover { background: var(--soft-blue); color: var(--navy); text-decoration: none; }
.site-nav a.is-active { background: var(--navy); color: #fff; }
.site-nav a.is-active:hover { background: var(--navy-2); }

/* dropdown */
.has-dropdown { position: relative; }
.dropdown {
  position: absolute; top: 100%; left: 0; z-index: 70;
  min-width: 240px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 8px; margin: 0; list-style: none;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown::before {
  content: ""; position: absolute; top: -8px; left: 0; right: 0; height: 8px;
}
.dropdown li { margin: 0; }
.dropdown a {
  width: 100%; padding: 10px 12px; border-radius: 8px; font-weight: 600;
  color: var(--ink);
}
.dropdown a:hover { background: var(--soft-blue); }
.dropdown .icon { color: var(--blue); }

.site-lang { display: flex; gap: 4px; align-items: center; font-size: 13px; }
.site-lang a { padding: 5px 9px; border-radius: 6px; color: var(--muted); font-weight: 800; }
.site-lang a.is-active { background: var(--soft-blue); color: var(--navy); }

.nav-toggle {
  display: none; margin-left: auto; border: 1px solid var(--line);
  background: #fff; border-radius: 9px; padding: 8px 10px; cursor: pointer; color: var(--navy);
}
.nav-toggle .icon { width: 22px; height: 22px; }

/* ============================ Main / typography ============================ */
.site-main { padding: 40px 0 64px; min-height: 60vh; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.22; }
h1 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 900; letter-spacing: -0.01em; }
h2 { font-size: 23px; margin: 30px 0 10px; }
h3 { font-size: 18px; margin: 18px 0 6px; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 16px; padding-left: 22px; }
li + li { margin-top: 5px; }
code { background: #eef2f8; padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
blockquote {
  margin: 16px 0; padding: 10px 16px; border-left: 4px solid var(--blue);
  background: var(--soft-blue); color: var(--ink); border-radius: 0 8px 8px 0;
}
article {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 34px; box-shadow: var(--shadow-sm);
}
article + article { margin-top: 20px; }

/* ============================ Hero ============================ */
.page-hero {
  position: relative; overflow: hidden;
  background:
    linear-gradient(135deg, rgba(10,42,99,.88) 0%, rgba(26,74,160,.78) 55%, rgba(39,101,178,.70) 100%),
    url("/shared-assets/banner-malaga.png") center/cover no-repeat,
    linear-gradient(135deg, #0a2a63 0%, #1a4aa0 60%, #2765b2 100%);
  color: #fff; padding: 72px 0; margin: -40px 0 36px;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { color: #fff; margin: 0 0 10px; font-size: clamp(30px, 4.6vw, 50px); }
.page-hero p { margin: 0 0 18px; font-size: 19px; opacity: .94; max-width: 760px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 20px; border-radius: 10px; font-weight: 800; font-size: 15.5px;
}
.cta:hover { text-decoration: none; }
.cta-solid { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }
.cta-solid:hover { background: #f0f4fb; }
.cta-accent { background: linear-gradient(135deg, #18b8a3 0%, #0e9c87 100%); color: #fff; box-shadow: 0 6px 16px rgba(14,156,135,.35); }
.cta-accent:hover { filter: brightness(1.06); }
.cta-ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.5); }
.cta-ghost:hover { background: rgba(255,255,255,.12); }

/* ============================ Topic cards ============================ */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px; margin: 18px 0; align-items: stretch; grid-auto-rows: 1fr;
}
.card-grid > .card { height: 100%; }  /* fill the row track so boxes match height */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); margin: 0;  /* grid uses gap, not margins */
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card h3 { margin-top: 0; }
.card p { color: #44506b; }
.card p:last-of-type { margin-bottom: 0; }
.card-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-weight: 800; font-size: 14.5px; }
.card > .card-cta { margin-top: auto; padding-top: 14px; }  /* bottom-align CTA so cards line up */
.icon-chip {
  width: 52px; height: 52px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px; color: #fff;
}
.icon-chip .icon { width: 27px; height: 27px; }

/* accent variants (apply to cards + topic page headers) */
.t-benefits { --t: var(--c-benefits); --t-wash: var(--c-benefits-wash); }
.t-convenio { --t: var(--c-convenio); --t-wash: var(--c-convenio-wash); }
.t-rif { --t: var(--c-rif); --t-wash: var(--c-rif-wash); }
.t-contact { --t: var(--c-contact); --t-wash: var(--c-contact-wash); }
.t-news { --t: var(--c-news); --t-wash: var(--c-news-wash); }
.card.t-benefits, .card.t-convenio, .card.t-rif, .card.t-contact, .card.t-news { border-top: 4px solid var(--t); }
.t-benefits .icon-chip, .t-convenio .icon-chip, .t-rif .icon-chip,
.t-contact .icon-chip, .t-news .icon-chip { background: var(--t); }
.card.t-benefits .card-cta, .card.t-convenio .card-cta, .card.t-rif .card-cta,
.card.t-contact .card-cta, .card.t-news .card-cta { color: var(--t); }

/* ============================ Topic page header band ============================ */
.topic-head {
  display: flex; align-items: center; gap: 18px;
  background: var(--t-wash); border: 1px solid var(--line); border-left: 6px solid var(--t);
  border-radius: var(--radius); padding: 22px 26px; margin-bottom: 22px;
}
.topic-head .icon-chip { margin: 0; background: var(--t); }
.topic-head h1 { margin: 0; color: var(--navy); }
.topic-head p { margin: 4px 0 0; color: #44506b; }

/* callouts */
.callout {
  border-left: 4px solid var(--t, var(--blue));
  background: var(--t-wash, var(--soft-blue));
  padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 16px 0;
}
.callout strong { color: var(--navy); }

/* ============================ Section band ============================ */
.section { padding: 8px 0 4px; }
.section-title { display: flex; align-items: center; gap: 10px; }
.section-title .icon { color: var(--blue); width: 1.4em; height: 1.4em; }

/* ============================ Tables ============================ */
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; }
table.data { border-collapse: collapse; width: 100%; font-size: 14.5px; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.data thead th { background: var(--navy); color: #fff; font-weight: 700; white-space: nowrap; }
table.data tbody tr:nth-child(even) { background: #f7f9fd; }
table.data tbody tr:hover { background: var(--c-rif-wash); }

/* ============================ News / announcements ============================ */
.news-list { display: grid; gap: 14px; margin: 16px 0; }
.news-item {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--c-news);
  border-radius: 0 12px 12px 0; padding: 18px 22px; box-shadow: var(--shadow-sm);
}
.news-item h3 { margin: 0 0 2px; }
.news-item .news-date { color: var(--muted); font-size: 13px; margin: 0 0 8px; font-weight: 600; }
.news-item p:last-child { margin-bottom: 0; }

/* ============================ Working-group cards ============================ */
.group-card { border-top: 4px solid var(--blue); }
.group-card .icon-chip { background: var(--blue); }
.group-card:nth-child(6n+1) { border-top-color: var(--c-benefits); }
.group-card:nth-child(6n+1) .icon-chip { background: var(--c-benefits); }
.group-card:nth-child(6n+2) { border-top-color: var(--c-convenio); }
.group-card:nth-child(6n+2) .icon-chip { background: var(--c-convenio); }
.group-card:nth-child(6n+3) { border-top-color: var(--c-rif); }
.group-card:nth-child(6n+3) .icon-chip { background: var(--c-rif); }
.group-card:nth-child(6n+4) { border-top-color: var(--c-contact); }
.group-card:nth-child(6n+4) .icon-chip { background: var(--c-contact); }
.group-card:nth-child(6n+5) { border-top-color: var(--c-news); }
.group-card:nth-child(6n+5) .icon-chip { background: var(--c-news); }

/* ============================ Delegates ============================ */
.delegate-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.delegate-card { flex-direction: row; align-items: center; gap: 14px; }
.delegate-card h3 { margin: 0; font-size: 16px; }
.delegate-avatar {
  width: 54px; height: 54px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; letter-spacing: .5px;
}
.delegate-photo { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.delegate-role { margin: 2px 0 0; color: #44506b; font-size: 14px; font-weight: 600; }
.delegate-div { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }

.callout-info {
  border-left-color: var(--blue); background: var(--soft-blue);
  display: flex; align-items: center; gap: 10px;
}
.callout-info .icon { color: var(--blue); width: 1.3em; height: 1.3em; flex: 0 0 auto; }

/* ============================ RIF detail buttons + modals ============================ */
.rif-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--c-rif); color: var(--c-rif); background: var(--c-rif-wash);
  border-radius: 8px; padding: 6px 12px; font-weight: 700; font-size: 13.5px; white-space: nowrap;
}
.rif-btn:hover { background: var(--c-rif); color: #fff; }
.rif-btn .icon { width: 15px; height: 15px; }
table.data td:last-child { text-align: right; }

.rif-modal {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: flex-start; justify-content: center;
  background: rgba(11, 26, 56, .55); padding: 6vh 16px; overflow: auto;
}
.rif-modal.open { display: flex; }
.rif-dialog {
  position: relative; background: #fff; border-radius: 16px;
  max-width: 560px; width: 100%; padding: 26px 28px;
  border-top: 5px solid var(--c-rif); box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.rif-dialog h3 { margin: 0 28px 0 0; }
.rif-close {
  position: absolute; top: 10px; right: 14px; border: 0; background: transparent;
  font-size: 28px; line-height: 1; cursor: pointer; color: var(--muted);
}
.rif-close:hover { color: var(--ink); }
.rif-dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 16px 0; }
.rif-dl dt { font-weight: 700; color: var(--navy); }
.rif-dl dd { margin: 0; color: #44506b; }
.rif-modal-cta { margin: 16px 0 0; }
@media (max-width: 560px) {
  .rif-dl { grid-template-columns: 1fr; gap: 2px 0; }
  .rif-dl dd { margin-bottom: 8px; }
}

.home-band { margin-top: 8px; }

/* ============================ Home layout (main + announcements sidebar) ============================ */
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.home-main { min-width: 0; }
.home-sidebar { position: sticky; top: 92px; }
.sidebar-card {
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--c-news);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.sidebar-card .section-title h2 { font-size: 18px; margin: 0 0 12px; }
.sidebar-card .news-list { gap: 12px; margin: 0; }
.sidebar-card .news-item { padding: 12px 14px; }
.sidebar-card .news-item h3 { font-size: 15px; }
.sidebar-card .news-item p:not(.news-date) { margin-bottom: 0; }
@media (max-width: 900px) {
  .home-layout { grid-template-columns: 1fr; gap: 20px; }
  .home-sidebar { position: static; }
  .sidebar-card .news-item p:not(.news-date) { -webkit-line-clamp: none; }
}
.home-band .section-title { margin-bottom: 6px; }

/* ============================ Contact form ============================ */
.mwc-form { display: grid; gap: 14px; margin: 18px 0 6px; max-width: 680px; }
.mwc-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mwc-form label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; color: var(--navy); }
.mwc-form input[type=text], .mwc-form input[type=email], .mwc-form textarea {
  font: inherit; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); width: 100%;
}
.mwc-form input:focus, .mwc-form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--soft-blue); }
.mwc-form .form-check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; color: #44506b; font-size: 13.5px; }
.mwc-form .form-check input { margin-top: 3px; }
.mwc-form button { width: fit-content; border: 0; cursor: pointer; }
.cta-solid.cta { background: var(--navy); color: #fff; }
.mwc-form .form-status { font-weight: 700; padding: 10px 14px; border-radius: 10px; }
.mwc-form .form-status.ok { background: var(--c-benefits-wash); color: #0a6b60; }
.mwc-form .form-status.err { background: #fdecec; color: #b3261e; }
.mwc-form .form-note { color: var(--muted); font-size: 13px; }

/* ============================ Footer ============================ */
.site-footer { background: var(--navy); color: #cdd8ee; margin-top: 56px; padding: 40px 0 18px; font-size: 14px; }
.site-footer-inner { display: grid; grid-template-columns: 1.5fr 2fr; gap: 36px; align-items: start; }
.site-footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.site-footer strong { color: #fff; font-size: 16px; }
.site-footer-tag { margin: 6px 0 12px; color: #9fb0d0; max-width: 420px; }
.site-footer h4 { color: #fff; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer a { color: #9fb0d0; }
.site-footer a:hover { color: #fff; }
.site-social { display: flex; gap: 10px; }
.site-social a {
  width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.08);
  display: inline-flex; align-items: center; justify-content: center; color: #cdd8ee;
}
.site-social a:hover { background: rgba(255,255,255,.18); color: #fff; }
.site-social .icon { width: 20px; height: 20px; }
.site-footer-bottom { margin-top: 30px; padding-top: 16px; border-top: 1px solid #1c4488; color: #8fa2c6; font-size: 12.5px; }

/* ============================ Tool embed ============================ */
.tool-frame-wrap { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.tool-frame-wrap iframe { width: 100%; height: 90vh; border: 0; display: block; }

/* ============================ Responsive ============================ */
@media (max-width: 1080px) {
  .site-header-inner { flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; order: 3; margin-left: auto; }
  .site-brand-logo { height: 64px; }
  .site-brand-text strong { font-size: 17px; }
  .site-nav > ul { justify-content: flex-start; }
  .site-nav { flex-basis: 100%; display: none; order: 4; }
  .site-header.nav-open .site-nav { display: block; }
  .site-nav > ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-nav a { justify-content: space-between; }
  .has-dropdown .dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; padding: 0 0 0 14px; display: none;
  }
  .has-dropdown.open .dropdown { display: block; }
  .site-lang { order: 2; margin-left: auto; }
  .site-footer-inner { grid-template-columns: 1fr; }
  .site-footer-cols { grid-template-columns: 1fr 1fr; }
  .mwc-form .form-row { grid-template-columns: 1fr; }
  .page-hero { padding: 44px 0; }
  article { padding: 20px 22px; }
}
