/* ==========================================
   Siderúrgica Requena · site.css
   ========================================== */

:root {
  /* Brand palette — all colors go through tokens */
  --sr-primary:       #003C77;
  --sr-primary-rgb:   0, 60, 119;
  --sr-primary-dark:  #002e5c;
  --sr-primary-2:     #0B63CE;
  --sr-primary-2-rgb: 11, 99, 206;
  --sr-bg:            #F4F6F8;
  --sr-text:          #0f172a;
  --sr-text-rgb:      15, 23, 42;
  --sr-ink:           #334155;
  --sr-muted:         #475569;
  --sr-border:        rgba(15, 23, 42, 0.08);
  --sr-surface:       rgba(15, 23, 42, 0.04);

  /* Typography */
  --sr-font-display: 'Barlow Condensed', system-ui, sans-serif;
  --sr-font-body:    'Barlow', system-ui, -apple-system, sans-serif;

  /* Easing curves */
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==================
   Base
   ================== */

html, body {
  font-family: var(--sr-font-body);
  color: var(--sr-text);
  font-size: 1rem;
  line-height: 1.6;
}

h1, h2, h3 {
  text-wrap: balance;
}

/* ==================
   Skip navigation (a11y)
   ================== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--sr-primary);
  color: #fff;
  padding: 0.5rem 1.25rem;
  z-index: 9999;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 0;
  transition: top 0.1s;
}
.skip-link:focus {
  top: 0;
}

/* ==================
   Muted text
   ================== */
.muted {
  color: var(--sr-muted);
}

/* ==================
   Brand mark
   ================== */
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--sr-primary);
  display: inline-block;
  flex-shrink: 0;
}

/* ==================
   Buttons
   ================== */
.btn-sr {
  background: var(--sr-primary);
  border-color: var(--sr-primary);
  color: #fff;
  transition: background 180ms var(--ease-out-quart),
              border-color 180ms var(--ease-out-quart),
              transform 100ms;
}
.btn-sr:hover {
  background: var(--sr-primary-dark);
  border-color: var(--sr-primary-dark);
  color: #fff;
}
.btn-sr:active {
  transform: scale(0.97);
}

/* ==================
   Header contact bar
   ================== */
.header-contact {
  background: var(--sr-primary);
  color: #fff;
  font-size: 0.9rem;
  padding-top: env(safe-area-inset-top);
}
.header-contact a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.header-contact a:hover {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
}

/* ==================
   Navbar
   ================== */
.navbar {
  background: #fff !important;
}
.navbar-brand img {
  height: 56px;
  width: auto;
}
.navbar .nav-link {
  font-weight: 500;
  color: var(--sr-ink);
  transition: color 150ms;
}
.navbar .nav-link:hover {
  color: var(--sr-primary);
}
.navbar .nav-link.active {
  font-weight: 700;
  color: var(--sr-primary) !important;
}
.navbar-shadow-2 {
  box-shadow: 0 4px 16px rgba(var(--sr-text-rgb), 0.08);
}

/* ==================
   Hero
   ================== */
.hero {
  background: linear-gradient(135deg,
    rgba(var(--sr-primary-rgb), 0.97),
    rgba(var(--sr-primary-rgb), 0.82));
  color: #fff;
}
.hero .lead {
  opacity: 0.9;
}

/* Replaces Bootstrap py-4; allows responsive override without !important */
.hero-inner {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}
@media (max-width: 991px) {
  .hero-inner {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw + 0.75rem, 3rem);
}

.hero-capabilities {
  padding: 2rem 0 2rem 2.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-year {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.hero-year-num {
  font-family: var(--sr-font-display);
  font-size: clamp(3.5rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.hero-year-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  padding-bottom: 0.2rem;
}

.hero-caps-list {
  list-style: none;
  padding: 0;
  margin: 0;
  line-height: 1.5;
}
.hero-caps-list li {
  padding: 0.5rem 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.hero-caps-list li:last-child {
  border-bottom: none;
}

/* ==================
   Hero entrance animation
   ================== */
@keyframes hero-enter {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-animate {
  animation: hero-enter 0.7s var(--ease-out-expo) both;
  opacity: 0;
}
.hero-animate:nth-child(1) { animation-delay: 0ms; }
.hero-animate:nth-child(2) { animation-delay: 120ms; }
.hero-animate:nth-child(3) { animation-delay: 230ms; }

/* ==================
   Scroll reveal (JS-driven; class added via JS)
   ================== */
.sr-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s var(--ease-out-quart),
              transform 0.65s var(--ease-out-quart);
}
.sr-reveal.sr-visible {
  opacity: 1;
  transform: none;
}

/* ==================
   Reduced motion — disable all animation
   ================== */
@media (prefers-reduced-motion: reduce) {
  .hero-animate {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .sr-reveal {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================
   Services list (replaces identical card grid)
   ================== */
.service-item {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  padding: 2rem 0;
}
@media (max-width: 767px) {
  .service-item {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

.service-main {
  flex: 1;
  min-width: 0;
}

.service-name {
  font-family: var(--sr-font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  color: var(--sr-text);
  text-decoration: none;
  display: block;
  line-height: 1.05;
  margin-bottom: 0.4rem;
  text-wrap: balance;
  transition: color 200ms var(--ease-out-quart);
}
.service-item--primary .service-name {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
}
@media (hover: hover) {
  .service-name:hover {
    color: var(--sr-primary);
  }
}
@media (hover: none) {
  .service-name:active {
    color: var(--sr-primary);
  }
}

.service-desc {
  color: var(--sr-muted);
  max-width: 55ch;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.service-link {
  color: var(--sr-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  align-self: center;
  letter-spacing: 0.01em;
  transition: color 150ms;
  flex-shrink: 0;
  padding: 0.75rem 0;
}
@media (hover: hover) {
  .service-link:hover {
    color: var(--sr-primary-dark);
    text-decoration: underline;
  }
}
@media (hover: none) {
  .service-link:active {
    color: var(--sr-primary-dark);
    text-decoration: underline;
  }
}
@media (pointer: coarse) {
  .service-link {
    padding: 1rem 0;
  }
}

.service-divider {
  border: none;
  border-top: 1px solid var(--sr-border);
  margin: 0;
}

/* ==================
   Section muted background
   ================== */
.section-muted {
  background: var(--sr-bg);
}

/* ==================
   Cards
   ================== */
.card {
  border: 1px solid var(--sr-border);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(var(--sr-text-rgb), 0.06);
}
.card .card-title {
  color: var(--sr-primary);
}

/* ==================
   Badges
   ================== */
.badge-sr {
  background: rgba(var(--sr-primary-rgb), 0.10);
  color: var(--sr-primary);
  border: 1px solid rgba(var(--sr-primary-rgb), 0.15);
}

/* ==================
   Page header (inner pages)
   ================== */
.page-header {
  background: linear-gradient(135deg,
    rgba(var(--sr-primary-rgb), 0.06),
    rgba(var(--sr-primary-2-rgb), 0.04));
  border-bottom: 1px solid var(--sr-border);
}
.hero a,
.page-header a {
  color: #fff;
}
.hero a:hover,
.page-header a:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* ==================
   News grid
   ================== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}
.news-card {
  grid-column: span 12;
  cursor: pointer;
}
@media (min-width: 768px) {
  .news-card { grid-column: span 6; }
}
@media (min-width: 1200px) {
  .news-card { grid-column: span 4; }
}
.news-thumb {
  aspect-ratio: 16/9;
  border-radius: 14px;
  overflow: hidden;
  background: var(--sr-bg);
}
.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==================
   Media blocks (full-bleed images)
   ================== */
.img-cover {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}
.media-block {
  border-radius: 18px;
  overflow: hidden;
  background: var(--sr-surface);
  max-height: 600px;
}
.media-block img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-block--natural {
  max-height: none;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.media-block--natural img {
  width: 100%;
  height: auto;
  object-fit: initial;
}

/* ==================
   Footer
   ================== */
.site-footer {
  background: var(--sr-primary);
  color: #fff;
  padding-bottom: max(3rem, env(safe-area-inset-bottom)) !important;
}
.site-footer a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}
.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}
.site-footer .muted {
  color: rgba(255, 255, 255, 0.75);
}
.site-footer .link-secondary {
  color: rgba(255, 255, 255, 0.9) !important;
}

/* ==================
   Hero mobile heritage line
   ================== */
.hero-founded {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  letter-spacing: 0.01em;
}
.hero-founded strong {
  color: rgba(255, 255, 255, 0.97);
  font-weight: 600;
}

.footer-logos img {
  max-height: 62px;
  width: auto;
  display: block;
}
.footer-logos .logo-wrap {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 82px;
  width: 100%;
}
.footer-logos .subv-logo img {
  height: 62px;
  width: auto;
  max-width: 100%;
  max-height: none;
}

/* ==================
   Cookie wall
   ================== */
body.cookie-locked { overflow: hidden; }

.cookie-wall {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top))
           max(16px, env(safe-area-inset-right))
           max(16px, env(safe-area-inset-bottom))
           max(16px, env(safe-area-inset-left));
}
.cookie-wall .cookie-panel {
  width: min(760px, 100%);
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.cookie-wall .cookie-panel-header {
  background: var(--sr-primary);
  color: #fff;
  padding: 16px 18px;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}
.cookie-wall .cookie-panel-body {
  padding: 16px 18px;
}

/* ==================
   Maps
   ================== */
.map-wrap { height: 360px; }
.map-wrap #map { height: 360px; }
.map-embed {
  width: 100%;
  height: 360px;
  border: 0;
  border-radius: 16px;
}

/* ==================
   Utilities
   ================== */
.bg-sr-primary {
  background: var(--sr-primary) !important;
  color: white;
}
.text-sr-primary { color: var(--sr-primary) !important; }
.text-on-primary { color: #fff !important; }
.padding_40px   { padding-bottom: 40px; }

/* ==================
   Legal pages
   ================== */
.legal-content h2 { font-size: 1.25rem; margin-top: 1.25rem; }
.legal-content p,
.legal-content li { color: #334155; }
.legal-content ul { margin-bottom: 1rem; }
