/*
Theme Name: Double Fault
Theme URI: https://doublefault.fi/
Author: Double Fault ry
Description: Kevyt ja helposti ylläpidettävä teema Double Fault ry:n verkkosivuille.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: double-fault
*/

:root {
  --gold-logo: #976d2d;
  --black: #050505;
  --surface: #0d0d0d;
  --surface-raised: #151515;
  --paper: #f3f0e8;
  --muted: #b9b5ad;
  --line: rgba(151, 109, 45, 0.42);
  --content: 1180px;
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--black);
  color: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

a { color: inherit; }
img { max-width: 100%; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  transform: translateY(-160%);
  background: var(--paper);
  color: var(--black);
  border-radius: 8px;
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.93);
  backdrop-filter: blur(14px);
}

.nav-wrap {
  width: min(calc(100% - 36px), var(--content));
  min-height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  color: var(--gold-logo);
  font-weight: 800;
  letter-spacing: .025em;
}

.brand img { width: 54px; height: 54px; object-fit: contain; }
.brand span { white-space: nowrap; }

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--paper);
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
}

.site-nav { display: flex; align-items: center; gap: 7px; }
.site-nav a {
  padding: 10px 12px;
  color: var(--paper);
  text-decoration: none;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 650;
}
.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] { color: var(--gold-logo); background: rgba(151,109,45,.12); }
.site-nav .nav-cta { margin-left: 8px; background: var(--gold-logo); color: var(--black); }
.site-nav .nav-cta:hover,
.site-nav .nav-cta:focus-visible,
.site-nav .nav-cta[aria-current="page"] { background: var(--paper); color: var(--black); }

.container { width: min(calc(100% - 36px), var(--content)); margin: 0 auto; }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 650px;
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.hero::before,
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(118deg, transparent 0 63%, rgba(151,109,45,.16) 63.1% 63.35%, transparent 63.45%),
    linear-gradient(28deg, transparent 0 72%, rgba(151,109,45,.10) 72.1% 72.4%, transparent 72.5%);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  align-items: center;
  gap: clamp(30px, 6vw, 90px);
  padding: 72px 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold-logo);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin-top: 0;
  color: var(--gold-logo);
  line-height: 1.08;
  text-wrap: balance;
}

h1 { margin-bottom: 22px; font-size: clamp(48px, 7vw, 92px); letter-spacing: -.045em; }
h2 { margin-bottom: 18px; font-size: clamp(32px, 4vw, 52px); letter-spacing: -.035em; }
h3 { margin-bottom: 10px; font-size: 23px; letter-spacing: -.02em; }

.lead { max-width: 680px; margin: 0 0 30px; font-size: clamp(20px, 2.3vw, 27px); line-height: 1.45; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--gold-logo);
  border-radius: 999px;
  background: var(--gold-logo);
  color: var(--black);
  text-decoration: none;
  font-weight: 800;
}
.button:hover, .button:focus-visible { background: var(--paper); border-color: var(--paper); }
.button.secondary { background: transparent; color: var(--gold-logo); }
.button.secondary:hover, .button.secondary:focus-visible { background: rgba(151,109,45,.15); border-color: var(--gold-logo); }

.hero-logo {
  width: min(100%, 460px);
  justify-self: end;
  filter: drop-shadow(0 22px 48px rgba(0,0,0,.55));
}

.section { padding: clamp(70px, 9vw, 118px) 0; }
.section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 34px; }
.section-head p { max-width: 560px; margin: 0; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card {
  position: relative;
  min-height: 260px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface-raised), #0b0b0b);
}
.card p { color: var(--muted); }
.card h3 a { color: var(--gold-logo); text-decoration: none; }
.card a { color: var(--gold-logo); font-weight: 750; text-underline-offset: 4px; }
.meta { margin: 0 0 16px; color: var(--gold-logo); font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.card.featured { grid-column: span 2; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr); gap: clamp(36px, 8vw, 100px); align-items: center; }
.split p { color: var(--muted); }
.fact-list { display: grid; gap: 1px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.fact { padding: 20px 22px; background: var(--surface-raised); }
.fact strong { display: block; color: var(--gold-logo); font-size: 22px; }
.fact span { color: var(--muted); }

.cta-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 34px;
  padding: clamp(30px, 5vw, 56px);
  border: 1px solid var(--gold-logo);
  border-radius: 24px;
  background: linear-gradient(110deg, rgba(151,109,45,.19), rgba(151,109,45,.05));
}
.cta-panel h2 { margin-bottom: 10px; }
.cta-panel p { margin: 0; color: var(--muted); }

.page-hero { position: relative; overflow: hidden; padding: clamp(76px, 10vw, 130px) 0 65px; border-bottom: 1px solid var(--line); }
.page-hero .container { position: relative; }
.page-hero h1 { max-width: 900px; }
.page-hero .lead { color: var(--muted); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(40px, 8vw, 100px); }
.prose { max-width: 760px; }
.prose h2 { margin-top: 55px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--paper); }
.prose a { color: var(--gold-logo); text-underline-offset: 4px; }
.prose img { height: auto; border-radius: var(--radius); }
.prose blockquote { margin-left: 0; padding-left: 22px; border-left: 3px solid var(--gold-logo); }
.prose input, .prose textarea, .prose select { max-width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--paper); font: inherit; }
.side-note { align-self: start; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.side-note p { margin-bottom: 0; color: var(--muted); }

.steps { display: grid; gap: 16px; margin: 34px 0; counter-reset: step; }
.step { position: relative; padding: 24px 24px 24px 72px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: 22px; left: 22px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--gold-logo); color: var(--black); font-weight: 900; }
.step h3 { margin-bottom: 6px; }
.step p { margin: 0; }

.contact-list { display: grid; gap: 18px; }
.contact-item { padding: 24px; border-left: 3px solid var(--gold-logo); background: var(--surface); }
.contact-item small { display: block; color: var(--muted); }
.contact-item a { color: var(--gold-logo); font-size: 21px; font-weight: 800; text-underline-offset: 4px; overflow-wrap: anywhere; }

.site-footer { border-top: 1px solid var(--line); padding: 38px 0; }
.footer-grid { display: flex; justify-content: space-between; align-items: center; gap: 24px; color: var(--muted); font-size: 14px; }
.footer-grid a { color: var(--gold-logo); }
.footer-brand { display: flex; align-items: center; gap: 12px; color: var(--gold-logo); font-weight: 800; }
.footer-brand img { width: 42px; height: 42px; object-fit: contain; }

.admin-edit-link { margin-top: 30px; font-size: 14px; }
.pagination { display: flex; gap: 12px; margin-top: 34px; }
.pagination a { color: var(--gold-logo); }
.empty-state { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 74px; left: 18px; right: 18px; padding: 12px; flex-direction: column; align-items: stretch; border: 1px solid var(--line); border-radius: 14px; background: #0b0b0b; box-shadow: 0 24px 80px rgba(0,0,0,.65); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 13px 15px; }
  .site-nav .nav-cta { margin: 5px 0 0; text-align: center; }
  .hero { min-height: auto; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-logo { width: min(72vw, 390px); justify-self: center; order: -1; }
  .lead { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .cards { grid-template-columns: 1fr 1fr; }
  .card.featured { grid-column: span 2; }
  .split, .content-grid { grid-template-columns: 1fr; }
  .side-note { width: 100%; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .nav-wrap { min-height: 72px; }
  .brand img { width: 45px; height: 45px; }
  .brand span { font-size: 15px; }
  .hero-grid { padding: 52px 0 64px; }
  .hero-logo { width: min(78vw, 310px); }
  .cards { grid-template-columns: 1fr; }
  .card.featured { grid-column: auto; }
  .section-head, .cta-panel, .footer-grid { align-items: flex-start; flex-direction: column; }
  .button { width: 100%; }
  .hero-actions { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
