/* =========================================================
   Intel Sustainability — styles.css
   Modular, RTL-ready, accessible, and performant
   ========================================================= */

/* Smooth anchor scrolling + nicer anchor landing */
html { scroll-behavior: smooth; }
.timeline-wrap { scroll-margin-top: 16px; }

/* ---- Intel-inspired color tokens ---- */
:root{
  --intel-blue: #0068B5;
  --intel-blue-dark: #053661;
  --ink: #0b1220;
  --bg: #f6f8fb;
  --card: #ffffff;
  --muted: #6b7280;
  --ring: #9cc9ff;
  --shadow: 0 6px 20px rgba(0,0,0,.12);
}

/* Equal-height card variables (responsive) */
:root{
  --card-fix-sm: 20rem;
  --card-fix-md: 22rem;
  --card-fix-lg: 24rem;
}

/* ---- Simple reset ---- */
*, *::before, *::after{ box-sizing: border-box; }
html, body{ height:100%; }
img{ max-width:100%; display:block; }
body{
  margin:0;
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);

  /* Subtle premium grid background (fixed) */
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 500px at 10% 10%, #f7fbff 0%, #eef4ff 60%, #eaf1ff 100%),
    linear-gradient(90deg, rgba(5, 54, 97, 0.05) 1px, transparent 1px),
    linear-gradient(0deg,  rgba(5, 54, 97, 0.05) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
  background-attachment: fixed;
}

/* Accessible skip link: hidden until focused */
.skip-link{
  position: absolute;
  inset-inline-start: 1rem;     /* logical "left" */
  inset-block-start: -200px;    /* hide above the viewport */
  background: #000;
  color: #fff;
  padding: .5rem .75rem;
  border-radius: .5rem;
  text-decoration: none;
  z-index: 10000;
  transition: inset-block-start .2s ease;
}
.skip-link:focus,
.skip-link:focus-visible{
  inset-block-start: 1rem;      /* slide into view */
  outline: 2px solid var(--ring);
}

/* Top utility bar */
.topbar .form-label { font-size: .9rem; color: var(--muted); }
.topbar select { min-width: 8rem; }

/* RTL helpers (logical alignment) */
body.rtl .text-start { text-align: end !important; }
body.rtl .text-end   { text-align: start !important; }
body.rtl .pad { padding-inline: 16px; padding-block: 14px 18px; }

/*  HERO */
header.hero{
  color:#fff;
  background: radial-gradient(1200px 500px at 15% 20%, #148be9 0%, var(--intel-blue) 50%, var(--intel-blue-dark) 100%);
  padding: clamp(24px, 5vw, 56px) 16px;
  animation: bg-pan 14s ease-in-out infinite alternate;
}
.hero .container{
  max-width:1100px; margin:0 auto;
  display:flex; align-items:center; gap: clamp(16px, 4vw, 40px);
}
.hero .brand{ flex:0 0 auto; }
/* Animated SVG sizing + gentle float */
.hero .brand .animated-intel{ width: clamp(120px, 18vw, 200px); animation: float 6s ease-in-out infinite; }
.hero .brand .animated-intel svg{ width: 100%; height: auto; display: block; fill: #fff; }
.hero .copy{ flex: 1 1 auto; min-width: 260px; }
.hero h1{
  margin:0 0 8px; font-weight:800; letter-spacing:.3px; line-height:1.15;
  font-size: clamp(24px, 4.4vw, 44px);
}
.hero p{ margin:0; color:#e6f1ff; max-width: 70ch; font-size: clamp(14px, 2.2vw, 18px); }

/* CTA */
a.cta{
  display:inline-block; margin-top:14px; padding:10px 14px;
  background:#ffffff; color:var(--intel-blue-dark);
  border-radius:999px; text-decoration:none; font-weight:700;
  border: 1px solid #e6ebf2; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
a.cta:hover{ transform: translateY(-2px); box-shadow: 0 12px 22px rgba(0,0,0,.14); }
a.cta:focus{ outline:none; box-shadow: 0 0 0 4px var(--ring), var(--shadow); }
.scroll-indicator{ display:inline-block; margin-inline-start:8px; animation: nudge 1.6s ease-in-out infinite; }

/* MIDDLE BAND */
.content-band{
  background: #eef4ff;
  padding: 8px 0 0;
}

/* TABS */
.tabs{ max-width: 1100px; margin: 24px auto 12px; padding: 0 16px; }
.tab-radio{ position: absolute; opacity: 0; pointer-events: none; }
.tabs .tabs-bar{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.tabs .tab{
  display: inline-block; text-align: center; padding: 10px 12px;
  border: 1px solid #e6ebf2; border-radius: 999px;
  background: #ffffff; color: var(--intel-blue-dark);
  font-weight: 700; cursor: pointer; user-select: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: var(--shadow);
}
.tabs .tab:hover{ transform: translateY(-1px); box-shadow: 0 10px 20px rgba(0,0,0,.10); }
.tabs .tab:focus{ outline: none; box-shadow: 0 0 0 4px var(--ring), var(--shadow); }

.tabs .panels{
  background: #fff; border: 1px solid #e6ebf2; border-radius: 16px;
  box-shadow: var(--shadow); padding: 16px 16px 6px;
}
.tabs .panel{ display: none; }
.tabs .panel-title{ margin: 6px 0 6px; font-size: 20px; }
.tabs .panel p{ margin: 0 0 10px; }
.tabs .panel ul{ margin: 0 0 8px 18px; }
.tabs .panel-note{ color: var(--muted); font-size: 14px; }

#tab-overview:checked ~ .panels .panel-overview{ display: block; }
#tab-goals:checked    ~ .panels .panel-goals{ display: block; }
#tab-impact:checked   ~ .panels .panel-impact{ display: block; }

#tab-overview:checked ~ .tabs-bar label[for="tab-overview"],
#tab-goals:checked    ~ .tabs-bar label[for="tab-goals"],
#tab-impact:checked   ~ .tabs-bar label[for="tab-impact"]{
  background: var(--intel-blue); color: #fff;
}

/* TIMELINE WRAP */
.timeline-wrap{ max-width: 1100px; margin: 18px auto 28px; padding: 0 16px; }
.timeline{
  display:flex; gap: 16px; align-items: stretch;
  overflow-x:auto; overflow-y:visible; /* allow reveal to breathe */
  padding: 8px 4px 18px;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
}
.timeline::-webkit-scrollbar{ height:10px; }
.timeline::-webkit-scrollbar-thumb{ background:#cfd8e3; border-radius:6px; }

/* CARD BASE */
.card{
  background: var(--card); border-radius: 16px; border: 1px solid #e6ebf2;
  box-shadow: var(--shadow);
  width: clamp(280px, 38vw, 340px); flex: 0 0 auto;
  scroll-snap-align: start; overflow: hidden; position: relative;
  transition: transform .18s ease, box-shadow .18s ease;
  opacity: 0; transform: translateY(10px); animation: rise .6s ease both;
  content-visibility: auto;
  contain-intrinsic-size: 380px 600px; /* rough placeholder size for perf */
}
.content-band .timeline .card{ overflow: visible; } /* reveal can overflow visually */
.card:nth-child(1){ animation-delay: .05s; }
.card:nth-child(2){ animation-delay: .10s; }
.card:nth-child(3){ animation-delay: .15s; }
.card:nth-child(4){ animation-delay: .20s; }
.card:nth-child(5){ animation-delay: .25s; }
.card:nth-child(6){ animation-delay: .30s; }
.card:nth-child(7){ animation-delay: .35s; }
.card:nth-child(8){ animation-delay: .40s; }
.card:nth-child(9){ animation-delay: .45s; }
.card:focus-within{ outline:none; box-shadow: 0 0 0 4px var(--ring), var(--shadow); }
.card:hover{ transform: translateY(-4px) scale(1.02); box-shadow: 0 14px 30px rgba(0,0,0,.15); }

/* Equal heights for Pillars + Timeline cards */
#sustainability-pillars .card,
.content-band .timeline .card {
  display: flex;
  flex-direction: column;
  height: var(--card-fix-sm);
}

/* Inner layout for scroll behavior */
#sustainability-pillars .card .card-body,
.content-band .timeline .card .pad {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Timeline media (fix image previewing issues) */
.media{ aspect-ratio: 16 / 9; background: linear-gradient(135deg, #e8f3ff, #d7eaff); }
.media img{
  width:100%; height:100%;
  object-fit: cover;
  display:block;
  image-rendering: auto;
}

/* Card content */
.pad{ padding: 14px 16px 18px; }
.eyebrow{ margin:0 0 4px; font-weight:700; color: var(--intel-blue-dark); font-size: 12px; letter-spacing:.1em; text-transform: uppercase; }
.title{ margin:2px 0 6px; font-size: 18px; line-height:1.25; }
.summary{ margin:0; color:var(--muted); font-size: 14px; }

/* Reveal body (.more) base animation */
.more{
  max-height: 0; overflow: hidden; opacity: 0; transform: translateY(-4px);
  transition: max-height .35s ease, opacity .25s ease, transform .25s ease;
}

/* General cards default reveal */
.card:hover .more, .card:focus-within .more{
  max-height: 240px; opacity: 1; transform: translateY(0);
}

/* Timeline-specific: title stays, summary hides; only .more scrolls */
.content-band .timeline .card .pad,
.content-band .timeline .card .title,
.content-band .timeline .card .summary {
  overflow: visible !important; /* avoid tiny scroll arrows on headings */
}

/* Smooth transitions for summary (hidden on hover) */
.content-band .timeline .card .summary {
  transition: opacity .25s ease, max-height .25s ease, transform .25s ease;
  will-change: opacity, transform, max-height;
}
.content-band .timeline .card:hover .summary,
.content-band .timeline .card:focus-within .summary {
  opacity: 0;
  max-height: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

/* Open the reveal more on hover/focus and let it scroll inside */
.content-band .timeline .card:hover .more,
.content-band .timeline .card:focus-within .more {
  max-height: 320px;      /* comfy cap */
  opacity: 1;
  transform: translateY(0);
  overflow: auto;         /* scroll only inside the body */
}

/* Pillars: let card text take available space; scroll if overflowing */
#sustainability-pillars .card .card-text {
  flex: 1 1 auto;
  overflow: auto;
}

/* Nicer, thinner scrollbar only inside the reveal */
.content-band .timeline .card .more{
  scrollbar-width: thin;
  scrollbar-color: #cfd8e3 transparent;
}
.content-band .timeline .card .more::-webkit-scrollbar{ width: 8px; }
.content-band .timeline .card .more::-webkit-scrollbar-thumb{
  background: #cfd8e3; border-radius: 8px;
}
.content-band .timeline .card .more::-webkit-scrollbar-track{ background: transparent; }

.hint{ text-align:center; color:#4b5563; font-size:14px; margin:4px 0 26px; }

/* FOOTER */
.site-footer{
  margin-top: 28px; padding: 28px 16px 34px;
  color: #eaf4ff;
  background: linear-gradient(180deg, var(--intel-blue) 0%, var(--intel-blue-dark) 100%);
}
.site-footer .foot-inner{ max-width: 1100px; margin: 0 auto; text-align: center; }
.site-footer .tagline{ margin: 0 0 10px; font-weight: 800; letter-spacing: .2px; font-size: clamp(18px, 2.8vw, 24px); }
.site-footer .legal{ display:block; margin-top: 10px; color: #cfe3ff; font-size: 12px; }
a.cta.invert{
  display:inline-block; margin-top: 8px; padding:10px 14px;
  background:#ffffff; color: var(--intel-blue-dark);
  border-radius:999px; text-decoration:none; font-weight:700;
  border: 1px solid #e6ebf2; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
a.cta.invert:hover{ transform: translateY(-2px); box-shadow: 0 12px 22px rgba(0,0,0,.14); }
a.cta.invert:focus{ outline:none; box-shadow: 0 0 0 4px var(--ring), var(--shadow); }

/* RESPONSIVE */
@media (max-width: 760px){
  .timeline{ flex-direction: column; overflow: visible; scroll-snap-type: none; }
  .card{ width: 100%; }
  .hero .container{ flex-direction: column; text-align:center; }
  .hero .copy{ max-width: 700px; }
  .tabs .tabs-bar{ grid-template-columns: 1fr; }
}
@media (min-width: 768px){
  #sustainability-pillars .card,
  .content-band .timeline .card { height: var(--card-fix-md); }
}
@media (min-width: 992px){
  #sustainability-pillars .card,
  .content-band .timeline .card { height: var(--card-fix-lg); }
}

/*  ACCESSIBILITY: prefers-reduced-motion */
@media (prefers-reduced-motion: reduce){
  .timeline{ scroll-behavior: auto; }
  .card{ transition: none; animation: none; opacity: 1; transform: none; }
  .more{ transition: none; }
  header.hero{ animation: none; }
  .scroll-indicator{ animation: none; }
}

/* KEYFRAMES */
@keyframes bg-pan{ 0%{background-position:0% 0%} 100%{background-position:5% 3%} }
@keyframes float{ 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }
@keyframes rise{ from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
@keyframes nudge{ 0%,100%{transform:translateX(0)} 50%{transform:translateX(4px)} }

/* Hide pieces of the logo until Anime.js reveals them */
#path10, #path18, #path14, #path16, #path8, #oval-border, #text2177 { opacity: 0; }
#rect{ transform-origin: 50% 50%; transform-box: fill-box; }

/* Forms & FAQ polish */
#subscribe .form-text { color: #6b7280; }
#faq .accordion-button { line-height: 1.25; }
#faq .accordion-body { color: var(--ink); }