/* =============================================
   EasyWrite — layout styles (header, footer, delt base)
   Tilpasset fra design-handoff/styles.css + styles-layout.css.
   Merk: .container/.btn fra prototypen er omdøpt til .ew-container/.ew-btn
   for å ikke kollidere med Bootstrap som lastes globalt på gamle sider.
   ============================================= */

/* ---------- Delt base (scoped til ew-flater så gamle sider ikke påvirkes) ---------- */
.site-header a, .site-footer a, .ew-page a { color: inherit; text-decoration: none; }
.site-header a:hover, .site-footer a:hover, .ew-page a:hover { text-decoration: none; }
.site-header button, .site-footer button, .ew-page button {
  font: inherit; cursor: pointer; border: none; background: none; color: inherit;
}
.site-header img, .site-footer img, .ew-page img { max-width: 100%; display: block; }
.ew-page input, .ew-page textarea, .ew-page select,
.site-footer input, .site-footer textarea { font: inherit; color: inherit; }
.ew-page section { position: relative; }

/* ---------- Type system ---------- */
:where(.ew-page, .site-header, .site-footer) .eyebrow {
  font-family: var(--f-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--burgundy);
}
.display-xl {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(48px, 7.2vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.display-xl em {
  font-style: italic;
  font-weight: 500;
  color: var(--burgundy);
}
.display-lg {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.display-lg em { font-style: italic; color: var(--burgundy); font-weight: 500; }
.display-md {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.005em;
}
.display-md em { font-style: italic; color: var(--burgundy); font-weight: 500; }
.display-sm {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.2;
}
.lede {
  font-family: var(--f-serif);
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.55;
  color: var(--ink-soft);
  font-weight: 400;
}
.kicker {
  font-family: var(--f-display);
  font-style: italic;
  color: var(--burgundy);
  font-size: 20px;
}

/* ---------- Buttons (ew-btn = prototypens .btn) ---------- */
.ew-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  border-radius: 2px;
  transition: all .25s var(--e-out);
  position: relative;
  overflow: hidden;
}
.ew-btn--primary {
  background: var(--ink);
  color: var(--cream);
}
.ew-btn--primary:hover {
  background: var(--burgundy);
  color: var(--cream);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.ew-btn--ghost {
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  background: transparent;
}
.ew-btn--ghost:hover {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.ew-btn--link {
  padding: 4px 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  font-family: var(--f-ui);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.ew-btn--link::after {
  content: "→";
  display: inline-block;
  margin-left: 6px;
  transition: transform .25s var(--e-out);
}
.ew-btn--link:hover::after { transform: translateX(4px); }

/* ---------- Layout ---------- */
.ew-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
}
.ew-container--narrow { max-width: 880px; }
.ew-container--text   { max-width: var(--max-w-text); }

:where(.ew-page, .site-header, .site-footer) .divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 auto;
  color: var(--burgundy);
}
:where(.ew-page, .site-header, .site-footer) .divider::before, :where(.ew-page, .site-header, .site-footer) .divider::after {
  content: "";
  height: 1px;
  width: 60px;
  background: currentColor;
  opacity: 0.5;
}
:where(.ew-page, .site-header, .site-footer) .divider svg { width: 18px; height: 18px; }

/* Hover lift card */
.card-hover {
  transition: transform .4s var(--e-out), box-shadow .4s var(--e-out);
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Page transitions */
.page-enter {
  animation: pageIn .5s var(--e-out) both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s var(--e-out), transform .8s var(--e-out);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
/* Uten JS skal ingenting være usynlig */
.no-reveal-js .reveal { opacity: 1; transform: none; }

/* Form */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-family: var(--f-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.field input, .field textarea, .field select {
  background: var(--milk);
  border: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule-strong);
  padding: 12px 14px;
  border-radius: 2px;
  font-family: var(--f-serif);
  font-size: 16px;
  transition: border-color .2s, background .2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--burgundy);
  background: var(--cream);
}
.field--error input, .field--error textarea {
  border-color: var(--burgundy);
}
.field-error {
  font-family: var(--f-ui);
  font-size: 12px;
  color: var(--burgundy);
  margin-top: 2px;
}

@media (max-width: 720px) {
  .ew-container { padding: 0 20px; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 237, 224, 0.78);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease, padding .25s ease;
}
.site-header.is-scrolled {
  background: rgba(245, 237, 224, 0.92);
  border-bottom-color: var(--rule);
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  padding-top: 18px;
  padding-bottom: 18px;
  transition: padding .25s ease;
}
.site-header.is-scrolled .header-inner {
  padding-top: 12px;
  padding-bottom: 12px;
}

.primary-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.site-header .nav-link {
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border-radius: 2px;
  color: var(--ink-soft);
  position: relative;
  transition: color .2s;
}
.site-header .nav-link::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 14px; right: 14px;
  height: 1px;
  background: var(--burgundy);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--e-out);
}
.site-header .nav-link:hover { color: var(--ink); }
.site-header .nav-link:hover::after,
.site-header .nav-link.is-active::after { transform: scaleX(1); }
.site-header .nav-link.is-active { color: var(--ink); }
.site-header .nav-link--icon {
  display: inline-flex; align-items: center; gap: 6px;
}

.header-cta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  position: relative;
}
.menu-toggle span {
  position: absolute;
  left: 8px; right: 8px;
  height: 1.5px;
  background: var(--ink);
  transition: transform .3s var(--e-out), opacity .2s;
}
.menu-toggle span:nth-child(1) { top: 13px; }
.menu-toggle span:nth-child(2) { top: 18px; }
.menu-toggle span:nth-child(3) { top: 23px; }
.menu-toggle.is-open span:nth-child(1) { top: 18px; transform: rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { top: 18px; transform: rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 0;
  background: var(--cream);
  border-top: 1px solid var(--rule);
}
.mobile-nav.is-open { display: flex; }
.mobile-link {
  font-family: var(--f-display);
  font-size: 28px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}
.mobile-link.is-active { color: var(--burgundy); }

@media (max-width: 960px) {
  .primary-nav, .header-cta { display: none; }
  .menu-toggle { display: block; }
  .header-inner { grid-template-columns: auto 1fr auto; }
  .header-inner .primary-nav { display: none; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 80px 0 32px;
  margin-top: 120px;
  position: relative;
  overflow: hidden;
  font-family: var(--f-serif);
  font-size: 17px;
  line-height: 1.6;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.4fr;
  gap: 60px;
  margin-bottom: 60px;
}
.footer-brand img {
  filter: invert(1) brightness(1.6) sepia(0.2);
}
.footer-tagline {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 19px;
  line-height: 1.4;
  color: var(--paper-warm);
  margin: 20px 0 24px;
  max-width: 320px;
}
.footer-social {
  display: flex;
  gap: 20px;
}
.footer-social a {
  font-family: var(--f-ui);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-warm);
  opacity: 0.7;
  transition: opacity .2s;
}
.footer-social a:hover { opacity: 1; color: var(--burgundy-soft); }

.footer-col h4 {
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--burgundy-soft);
  margin: 0 0 18px;
}
.footer-col a {
  display: block;
  font-family: var(--f-serif);
  font-size: 16px;
  padding: 6px 0;
  color: var(--paper);
  opacity: 0.82;
  transition: opacity .2s, color .2s, transform .2s;
}
.footer-col a:hover { opacity: 1; color: var(--burgundy-soft); transform: translateX(3px); }

.footer-news p {
  font-size: 14px;
  color: var(--paper-warm);
  opacity: 0.85;
  margin: 0 0 14px;
  max-width: 280px;
}
.news-form {
  display: flex;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 2px;
  overflow: hidden;
  max-width: 280px;
}
.news-form input {
  flex: 1;
  background: none;
  border: none;
  padding: 10px 14px;
  color: var(--paper);
  font-size: 14px;
  outline: none;
  min-width: 0;
}
.news-form input::placeholder { color: rgba(245,237,224,0.5); }
.news-form button {
  background: var(--burgundy);
  color: var(--cream);
  padding: 0 16px;
  font-size: 18px;
  transition: background .2s;
}
.news-form button:hover { background: var(--burgundy-soft); color: var(--ink); }
.news-done {
  padding: 10px 14px;
  font-family: var(--f-display);
  font-style: italic;
  color: var(--paper-warm);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  border-top: 1px solid rgba(245,237,224,0.14);
  font-family: var(--f-ui);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--paper-warm);
  opacity: 0.7;
}
.footer-meta { display: flex; gap: 20px; }
.footer-meta a:hover { color: var(--burgundy-soft); }

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px 30px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 14px;
    text-align: center;
  }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Page header (brukes på undersider) ---------- */
:where(.ew-page) .page-header {
  padding: 96px 0 40px;
}
:where(.ew-page) .page-header-rule {
  margin: 60px 0 0;
}
@media (max-width: 720px) {
  :where(.ew-page) .page-header { padding: 56px 0 28px; }
}
