/* =====================================================================
   SafeShare — Layout: contenedor, cabecera, secciones, grids, pie
   ===================================================================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- Cabecera ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--color-header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.header.is-scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: var(--shadow-soft);
}
.header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--sp-m);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  color: var(--color-text);
  font-weight: var(--fw-bold);
  font-size: var(--fs-l);
  letter-spacing: -0.02em;
}
.brand:hover { color: var(--color-text); }
.brand__mark {
  width: 36px; height: 36px;
  border-radius: var(--radius-xs);
  background: var(--color-accent);
  color: var(--color-text-on-brand);
  display: grid; place-items: center;
}

.header__nav {
  display: none;
  gap: var(--sp-m);
  margin-left: var(--sp-s);
}
.header__nav a {
  color: var(--color-text-secondary);
  font-weight: var(--fw-medium);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
}
.header__nav a:hover { color: var(--color-accent-text); }
@media (min-width: 960px) { .header__nav { display: flex; } }

.header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2xs);
  flex-shrink: 0;
}
.header__label { margin-left: var(--sp-3xs); }
@media (max-width: 767px) {
  .header__inner { gap: var(--sp-s); }
  .header__label { display: none; }
  .header__actions .btn--outline { width: var(--cta-h-s); padding: 0; }
}
@media (max-width: 359px) {
  .brand > span:last-child { display: none; }
}

/* ---------- Secciones ---------- */
.section { padding-top: var(--section-gap); }

.section__head {
  display: grid;
  gap: var(--sp-s) var(--sp-m);
  align-items: end;
  margin-bottom: var(--sp-l);
}
@media (min-width: 768px) {
  .section__head { grid-template-columns: 1fr 1fr; }
  .section__head .lead { padding-bottom: 6px; }
}
.section__head .tag { margin-bottom: var(--sp-s); }

/* Bloque redondeado sobre fondo tintado */
.block {
  background: var(--color-bg-subdued);
  border-radius: var(--radius-2xl);
  padding: var(--block-pad) var(--sp-xl);
}
@media (max-width: 767px) {
  .block { border-radius: var(--radius-l); padding: var(--block-pad) var(--sp-m); }
}

/* ---------- Grids ---------- */
.grid { display: grid; gap: var(--sp-m); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--media {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-2xl);
}
@media (max-width: 1023px) {
  .grid--media { gap: var(--sp-xl); }
}
@media (max-width: 767px) {
  .grid--2, .grid--media { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: var(--sp-m);
  padding-top: var(--sp-m);
  align-items: stretch;
}
.hero__brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: var(--sp-m);
}
.hero__title { color: var(--color-text-on-brand); }
.hero__lead { color: var(--color-text-on-brand-muted); max-width: 46ch; }
@media (max-width: 1023px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Vista "abrir enlace" ---------- */
.open {
  padding-top: var(--sp-m);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-m);
  align-items: stretch;
}
@media (max-width: 1023px) {
  .open { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Pie ---------- */
.footer {
  margin-top: var(--section-gap);
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: var(--sp-xl) 0 var(--sp-l);
}
.footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-m) var(--sp-xl);
  padding-bottom: var(--sp-m);
  border-bottom: 1px solid var(--color-footer-chip);
}
.footer .brand, .footer .brand:hover { color: var(--color-footer-text); }
.footer .brand__mark { background: var(--color-footer-chip); color: var(--color-footer-text); }
.footer__tagline {
  color: var(--color-footer-muted);
  margin-top: var(--sp-xs);
  max-width: 44ch;
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
}
.footer__links { display: flex; flex-wrap: wrap; gap: var(--sp-xs) var(--sp-m); padding-top: var(--sp-2xs); }
.footer__links a {
  color: var(--color-footer-muted);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: var(--fw-medium);
}
.footer__links a:hover { color: var(--color-footer-text); }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2xs) var(--sp-m);
  justify-content: space-between;
  padding-top: var(--sp-s);
  font-size: var(--fs-2xs);
  line-height: var(--lh-2xs);
  color: var(--color-footer-muted);
}
.footer__bottom p { color: inherit; }
@media (max-width: 767px) {
  .footer { border-radius: var(--radius-l) var(--radius-l) 0 0; }
}
