/* ==========================================================================
   Ribes & Associats — full stylesheet
   Tots els colors i tipografies surten de variables: canvia-les aquí dalt
   per ajustar la marca sense tocar la resta del CSS.
   ========================================================================== */

:root {
  /* Colors reals de la web original (Ribes & Associats) */
  --navy:        #045184;   /* blau fons / seccions fosques */
  --navy-deep:   #033b62;   /* blau fons una mica més fosc */
  --blue:        #008afc;   /* blau viu — color de marca / accent */
  --blue-soft:   #2a9bff;
  --accent:      #008afc;   /* accent = blau viu */
  --accent-dark: #045184;   /* hover dels botons accent */
  --ink:         #1c1c1c;   /* text (negre quasi pur, com l'original) */
  --muted:       #555b63;
  --line:        #e1e6ec;
  --bg:          #ffffff;
  --bg-soft:     #f2f7fc;
  --bg-soft-2:   #e4f1fd;
  --white:       #ffffff;
  --radius:      14px;
  --radius-sm:   9px;
  --shadow:      0 10px 30px rgba(4, 81, 132, .10);
  --shadow-sm:   0 4px 14px rgba(4, 81, 132, .08);
  --maxw:        1180px;
  --font-display:'Gilda Display', Georgia, 'Times New Roman', serif;  /* titulars grans */
  --font-head:   'Geist', Arial, Helvetica, sans-serif;               /* subtítols / UI */
  --font-body:   Arial, Helvetica, sans-serif;                        /* cos */
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

h1, h2, h3, h4 { line-height: 1.16; }
h1, h2 { font-family: var(--font-display); font-weight: 400; color: var(--blue); }  /* serif blau, com l'original */
h3, h4 { font-family: var(--font-head); font-weight: 600; color: var(--navy); }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(2rem, 3.8vw, 3rem); }
h3 { font-size: 1.22rem; }
p { color: var(--muted); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 84px 0; }
.section--soft { background: var(--bg-soft); }
.section--tight { padding: 56px 0; }
.eyebrow {
  display: inline-block; font-family: var(--font-head); font-weight: 600;
  font-size: .9rem; letter-spacing: .3px; text-transform: none;
  color: var(--blue); margin-bottom: 12px;
}
.lead { font-size: 1.12rem; color: var(--muted); max-width: 720px; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-head); font-weight: 600; font-size: .98rem;
  padding: 13px 28px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: .2s ease; white-space: nowrap;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); transform: translateY(-2px); }
.btn--ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.btn--white { background:#fff; color: var(--blue); }
.btn--white:hover { background: rgba(255,255,255,.88); transform: translateY(-2px); }
.btn--outline { border-color: var(--navy); color: var(--navy); }
.btn--outline:hover { background: var(--navy); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; height: 76px;
}
.nav__logo img { height: 46px; width: auto; }
.nav__menu { display: flex; align-items: center; gap: 4px; }
.nav__menu > li { position: relative; }
.nav__link {
  display: block; font-family: var(--font-head); font-weight: 500; font-size: .97rem;
  color: var(--navy); padding: 10px 14px; border-radius: 8px; transition: .18s;
}
.nav__link:hover, .nav__link.is-active { color: var(--accent-dark); background: var(--bg-soft); }
.nav__link.is-active { font-weight: 600; }

/* dropdown */
.has-dropdown > .nav__link::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 7px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); opacity: .7;
}
.dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 8px; opacity: 0; visibility: hidden;
  transform: translateY(8px); transition: .2s;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a {
  display: block; padding: 10px 14px; border-radius: 7px; font-size: .94rem;
  font-family: var(--font-head); font-weight: 500; color: var(--navy);
}
.dropdown a:hover { background: var(--bg-soft); color: var(--accent-dark); }

.nav__lang a {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: .82rem; letter-spacing: .5px;
  color: var(--navy); border: 1.5px solid var(--line); border-radius: 8px;
  padding: 7px 11px; margin-left: 4px; transition: .18s;
}
.nav__lang a:hover { border-color: var(--blue); color: var(--blue); background: var(--bg-soft); }
.nav__cta { margin-left: 6px; }
.nav__toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: 8px;
  flex-direction: column; gap: 5px;
}
.nav__toggle span { width: 26px; height: 2.5px; background: var(--navy); border-radius: 2px; transition: .25s; }

/* ---------- Hero ---------- */
.hero {
  position: relative; background: var(--blue);
  color: #fff; overflow: hidden;
}
.hero::after {
  content:""; position:absolute; inset:0;
  background: radial-gradient(900px 500px at 85% -25%, rgba(255,255,255,.16), transparent 60%);
  pointer-events:none;
}
.hero__inner { position: relative; z-index: 2; padding: 96px 0 100px; max-width: 820px; }
.hero h1 { color:#fff; font-family: var(--font-head); font-weight: 800;
  font-size: clamp(2.5rem, 5.8vw, 4.3rem); letter-spacing: -1.2px; margin: 18px 0 22px; }
.hero__eyebrow { color: rgba(255,255,255,.95); letter-spacing: .3px; text-transform: none;
  font-family: var(--font-head); font-weight: 700; font-size: 1rem; }
.hero p { color: rgba(255,255,255,.85); font-size: 1.18rem; max-width: 620px; }
.hero__actions { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero--small .hero__inner { padding: 70px 0 64px; }

/* hero amb foto de fons (blau a sobre, com l'original) */
.hero--photo { background: var(--blue); }
.hero--photo::after {
  background:
    linear-gradient(100deg, rgba(0,138,252,.94) 38%, rgba(0,138,252,.62) 100%),
    var(--hero-img) center/cover no-repeat;
  opacity: 1;
}

/* page header (interior) */
.page-hero { position:relative; background: var(--blue); color:#fff; overflow:hidden; }
.page-hero::after { content:""; position:absolute; inset:0; pointer-events:none;
  background: radial-gradient(800px 420px at 90% -30%, rgba(255,255,255,.16), transparent 60%); }
.page-hero__inner { padding: 80px 0 68px; position: relative; z-index: 2; }
.page-hero h1 { color:#fff; font-family: var(--font-head); font-weight: 800; letter-spacing: -1px; margin-bottom: 14px; }
.page-hero p { color: rgba(255,255,255,.92); max-width: 680px; }
.page-hero .eyebrow { color: rgba(255,255,255,.95); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: .22s; box-shadow: var(--shadow-sm);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #d4dbe6; }
.card__icon {
  width: 46px; height: 46px; border-radius: 11px; margin-bottom: 16px;
  background: var(--bg-soft-2); color: var(--accent-dark);
  display: grid; place-items: center;
}
.card__icon svg { width: 24px; height: 24px; }
.card h3 { margin-bottom: 8px; color: var(--navy); }
.card p { font-size: .97rem; }

/* service list (serveis page) */
.service-block { padding: 30px 0; border-bottom: 1px solid var(--line); }
.service-block:last-child { border-bottom: 0; }
.service-block h3 { color: var(--navy); font-size: 1.35rem; margin-bottom: 10px; display:flex; gap:12px; align-items:baseline; }
.service-block h3 .num { color: var(--accent); font-size: 1rem; font-weight:600; font-family: var(--font-head); }
.service-block p { font-size: 1.02rem; }

/* feature list (client subpages) */
.feature-list { display: grid; gap: 18px; }
.feature-list .feature {
  background:#fff; border:1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.feature h4 { color: var(--navy); font-size: 1.05rem; margin-bottom: 5px; }
.feature p { font-size: .96rem; margin: 0; }

/* clients chips grid */
.client-grid { display:grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.client-card {
  display:flex; flex-direction:column; justify-content:space-between;
  background: var(--navy); color:#fff; border-radius: var(--radius); padding: 28px;
  min-height: 150px; transition:.22s; position:relative; overflow:hidden;
}
.client-card::before{
  content:""; position:absolute; right:-30px; bottom:-30px; width:120px; height:120px;
  background: radial-gradient(circle, rgba(0,138,252,.55), transparent 70%);
}
.client-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.client-card h3 { color:#fff; font-size:1.3rem; position:relative; }
.client-card .go { color: var(--accent); font-family:var(--font-head); font-weight:600; font-size:.92rem; position:relative; }

/* two-column with image */
.split { display:grid; grid-template-columns: 1.05fr .95fr; gap: 50px; align-items:center; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); width:100%; object-fit:cover; }
.split-photo { aspect-ratio: 4/5; max-height: 560px; }

/* underlined link list (seccions de la home, com l'original) */
.linklist { display:grid; grid-template-columns: 1fr 1fr; gap: 0 30px; margin: 24px 0 30px; }
.linklist a {
  display:block; padding: 12px 2px; color: var(--blue);
  font-family: var(--font-head); font-weight: 600; font-size: 1.02rem;
  border-bottom: 1px solid var(--line); transition: .18s;
}
.linklist a:hover { color: var(--navy); border-bottom-color: var(--blue); padding-left: 6px; }
@media (max-width: 600px) { .linklist { grid-template-columns: 1fr; } }

/* intro "A Ribes & Associats" — títol gran esquerra + paràgraf dreta */
.intro-split { display:grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items:start; }
.intro-split__title { font-size: clamp(2.2rem, 4.6vw, 3.4rem); }
.intro-split__text { font-size: 1.06rem; }

/* banda fotogràfica a tota amplada */
.photo-band {
  height: 440px; background-size: cover; background-position: center;
  background-repeat: no-repeat; background-color: var(--ink);
}

/* secció Audicubic (fons blanc, alineada a l'esquerra, com l'original) */
.audicubic h2 { max-width: 16ch; }
.aud-line { display:flex; align-items:center; gap: 22px; flex-wrap:wrap; margin-top: 20px; }
.aud-line .aud-pre { font-size:1.05rem; color: var(--muted); }
.aud-line .aud-logo { display:inline-block; transition:.2s; }
.aud-line .aud-logo:hover { transform: translateY(-2px); }
.aud-line .aud-logo img { height: 60px; width:auto; }

/* banda final "Contacta amb nosaltres" amb foto + overlay blau */
.contact-cta { position:relative; overflow:hidden; padding: 96px 0; text-align:center; color:#fff; }
.contact-cta::before {
  content:""; position:absolute; inset:0; z-index:0;
  background:
    linear-gradient(100deg, rgba(0,138,252,.92) 30%, rgba(4,81,132,.80) 100%),
    var(--cta-img) center/cover no-repeat;
}
.contact-cta .container { position:relative; z-index:1; }
.contact-cta h2 { color:#fff; font-size: clamp(2rem, 4.4vw, 3.1rem); }
.contact-cta p { color:#fff; font-family: var(--font-head); font-weight:700; font-size:1.15rem; margin: 8px 0 26px; }
@media (max-width: 760px) { .intro-split { grid-template-columns: 1fr; gap: 18px; } .photo-band { height: 300px; } }
.prose p { margin-bottom: 16px; color: var(--muted); }
.prose p:last-child { margin-bottom: 0; }

/* membership logos */
.logos-row { display:flex; flex-wrap:wrap; gap: 34px; align-items:center; justify-content:center; }
.logos-row img { height: 56px; width:auto; filter: grayscale(1); opacity:.8; transition:.2s; }
.logos-row img:hover { filter:none; opacity:1; }

/* CTA band */
.cta-band { background: var(--blue); color:#fff; border-radius: 0; }
.cta-band .container { display:flex; align-items:center; justify-content:space-between; gap:30px; flex-wrap:wrap; padding-top:54px; padding-bottom:54px; }
.cta-band h2 { color:#fff; }
.cta-band p { color: rgba(255,255,255,.82); margin-top:6px; }

/* legal / long text pages */
.legal { max-width: 820px; }
.legal h2 { font-size: 1.25rem; margin: 30px 0 10px; color: var(--navy); }
.legal h3 { font-size: 1.05rem; margin: 22px 0 8px; color: var(--blue); }
.legal p { margin-bottom: 14px; color: var(--ink); font-size: 1rem; }
.legal a { color: var(--blue); text-decoration: underline; }

/* ---------- Contact ---------- */
.contact-grid { display:grid; grid-template-columns: 1.1fr .9fr; gap: 46px; }
.form-field { margin-bottom: 18px; }
.form-row { display:grid; grid-template-columns: 1fr 1fr; gap: 18px; }
label { display:block; font-family:var(--font-head); font-weight:500; font-size:.9rem; color: var(--navy); margin-bottom:6px; }
input, textarea {
  width:100%; font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  padding: 13px 15px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background:#fff; transition:.18s;
}
input:focus, textarea:focus { outline:none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,74,125,.12); }
textarea { min-height: 150px; resize: vertical; }
.hp { position:absolute; left:-9999px; }
.contact-info { background: var(--navy); color:#fff; border-radius: var(--radius); padding: 34px; }
.contact-info h3 { color:#fff; margin-bottom: 18px; }
.contact-info .row { display:flex; gap:13px; margin-bottom:18px; align-items:flex-start; }
.contact-info .row svg { width:20px; height:20px; flex:0 0 20px; color: var(--accent); margin-top:3px; }
.contact-info a { color:#fff; }
.contact-info a:hover { color: var(--accent); }
.contact-info .muted { color: rgba(255,255,255,.7); font-size:.92rem; }

.map-section { margin-top: 8px; }
.map-section iframe { width:100%; filter: grayscale(.15); }

.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 22px; font-size:.97rem; }
.alert--ok { background:#e7f6ec; border:1px solid #b6e2c4; color:#1d6b3a; }
.alert--err { background:#fde9e7; border:1px solid #f3c1bb; color:#a8332a; }

/* ---------- Footer (clar) ---------- */
.site-footer { background:#fff; color: var(--muted); padding: 46px 0 30px; border-top: 3px solid var(--blue); }
.footer-main {
  display:flex; flex-direction:column; align-items:center; gap:10px;
  text-align:center; padding: 32px 0 8px;
}
.site-footer img.flogo { height: 52px; width:auto; margin-bottom: 6px; }
.site-footer .addr { font-size:.96rem; line-height:1.6; color: var(--muted); }
.footer-contact { font-size:.96rem; }
.site-footer a { color: var(--navy); transition:.18s; }
.site-footer a:hover { color: var(--blue); }
.footer-bottom {
  margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line);
  display:flex; justify-content:space-between; gap:14px; flex-wrap:wrap;
  align-items:center; font-size:.85rem; color: var(--muted);
}
.footer-legal { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.footer-bottom a { font-size:.85rem; }
.site-footer .dot { opacity:.45; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
  .grid--4 { grid-template-columns: repeat(2,1fr); }
  .grid--3 { grid-template-columns: repeat(2,1fr); }
  .client-grid { grid-template-columns: repeat(2,1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav__toggle { display:flex; }
  .nav__menu {
    position: fixed; inset: 76px 0 auto 0; background:#fff; flex-direction:column;
    align-items:stretch; gap:0; padding: 12px 16px 22px; border-bottom:1px solid var(--line);
    box-shadow: var(--shadow); transform: translateY(-130%); transition: transform .3s ease;
    max-height: calc(100vh - 76px); overflow:auto;
  }
  .nav__menu.is-open { transform: translateY(0); }
  .nav__link { padding: 14px 12px; border-radius:8px; }
  .dropdown {
    position: static; opacity:1; visibility:visible; transform:none; box-shadow:none;
    border:0; border-left:2px solid var(--line); margin:2px 0 6px 14px; padding:0;
  }
  .nav__cta { margin: 10px 0 0; }
  .has-dropdown > .nav__link::after { float:right; margin-top:6px; }
  .grid--2, .grid--3, .grid--4, .client-grid, .footer-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  body { font-size: 16px; }
}
