/*
Theme Name: ISDS Days of Action
Version: 0.3
*/

/* ===== Base ===== */
*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --paper-light: #ffffff;
  --paper-dark:  #3a2456;
  --ink:         #2b2b32;
  --ink-invert:  #ffffff;
  --accent:      #c4604f;
  --header-h:    64px;
  --font-head:   "Unbounded", sans-serif;
  --font-body:   "Space Grotesk", system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper-light);
  line-height: 1.7;
}

/* ===== Header / top menu ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: #ffffff;
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 200;
}

.header-inner {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: bold;
  letter-spacing: 2px;
}
.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--accent);
}
.logo-text { 
  font-family: var(--font-head); 
  font-weight: 800; 
  font-size: 20px; 
  line-height: 1;
}

.header-end {
  display: flex;
  align-items: center;
  gap: 28px;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
}
.lang-switch a {
  text-decoration: none;
  color: var(--ink);
  opacity: 0.55;
  padding: 2px 6px;
  border-radius: 4px;
}
.lang-switch a:hover { opacity: 1; }
.lang-switch a.is-active {
  opacity: 1;
  background: var(--accent);
  color: #fff;
}
.lang-switch--menu { display: none; }

/* Nav */
.primary-nav ul {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.primary-nav a {
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0.08em;
  padding: 6px 0;
  position: relative;
}
.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.primary-nav a:hover::after { width: 100%; }

.nav-close { display: none; }

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ===== Sections ===== */
main { padding-top: var(--header-h); }

.section {
  position: relative;
  padding: 96px 24px 120px;
}
.section-page {
  padding: 96px 24px 60px;
}
/* Sections that sit below a triangle get extra clearance above the headline */
.section + .section {
  padding-top: 150px;
}
.section-content {
  /* max-width: 760px; */
  max-width: 860px;
  margin: 0 auto;
}
.section h1,
.section h2 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.9rem, 5vw, 3.4rem);
  line-height: 1.15;
  letter-spacing: 0;
  margin: 0 0 24px;
}
.section p { margin: 0 0 20px; font-size: 1.1rem; }

.section--light { --paper: var(--paper-light); background: var(--paper-light); color: var(--ink); }
.section--dark  { --paper: var(--paper-dark);  background: var(--paper-dark);  color: var(--ink-invert); }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 16px;
}
.lead { font-size: 1.3rem; }
.section p.eyebrow {
  font-size: 1.2rem;
  color: #f57863;
}

.btn,
.wp-block-button__link {
  display: inline-block;
  margin-top: 8px;
  padding: 14px 28px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover,
.wp-block-button__link:hover { transform: translateY(-2px); filter: brightness(1.08); }

.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* Demands list */
.demands {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}
.demands li {
  position: relative;
  padding: 14px 0 14px 34px;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.demands li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 14px;
  color: var(--accent);
  font-weight: 700;
}

.logo-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 20px;
  margin: 0 0 32px;
}
.logo-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 90px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px dashed rgba(0, 0, 0, 0.18);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: rgba(0, 0, 0, 0.4);
}

.logo-slot:has(img) {
  background: none;
  border: none;
  padding: 0;
}
.logo-slot img {
  width: auto;
  height: 52px;
  max-width: 100%;
  object-fit: contain;
}

.logo-slot a {
  display: inline-flex;
  align-items: center;
  opacity: 0.85;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.logo-slot a:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 8px;
}
.resource {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.15s ease, background 0.15s ease;
}
.resource:hover { transform: translateY(-4px); background: rgba(255, 255, 255, 0.12); }
.resource-img {
  display: block;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--accent), #7a3a30);
}
.resource-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.25;
  padding: 16px 16px 4px;
}
.resource-url {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--accent);
  padding: 0 16px 16px;
  word-break: break-word;
}

.resource-title:last-child { padding-bottom: 18px; }

.rip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -60px;
  height: 60px;
  background: var(--paper);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  z-index: 3;
  pointer-events: none;
}


.post-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-bottom: 48px;
}
.post-summary {
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.post-summary:last-child { border-bottom: none; padding-bottom: 0; }
.post-summary h2 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  line-height: 1.15;
  margin: 4px 0 12px;
}
.post-summary h2 a { color: inherit; text-decoration: none; }
.post-summary h2 a:hover { color: var(--accent); }
.post-summary .eyebrow { margin-bottom: 4px; }

.pagination,
.page-links {
  margin-top: 16px;
  font-family: var(--font-body);
  font-weight: 500;
}
.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pagination .page-numbers {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink);
}
.pagination .page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.pagination .page-numbers.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-family: var(--font-body);
  font-weight: 500;
}
.post-nav a { color: var(--accent); text-decoration: none; }
.post-nav a:hover { text-decoration: underline; }

.wp-block-search__inside-wrapper,
.search-form {
  display: flex;
  gap: 8px;
  max-width: 480px;
  margin-top: 8px;
}
.search-field,
.wp-block-search__input {
  flex: 1;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
.search-field:focus,
.wp-block-search__input:focus {
  outline: none;
  border-color: var(--accent);
}
/* The submit button reuses the .btn styling via .wp-block-search__button */
.search-submit,
.wp-block-search__button {
  margin: 0;
  padding: 12px 22px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.search-submit:hover,
.wp-block-search__button:hover { filter: brightness(1.08); }

.section--dark .post-nav a,
.section--dark .pagination .page-numbers { color: var(--ink-invert); }
.section--dark .pagination .page-numbers { border-color: rgba(255, 255, 255, 0.3); }

/* ===== Footer ===== */
.site-footer {
  background: var(--paper-dark);
  color: var(--ink-invert);
  text-align: center;
  padding: 40px 24px;
  font-family: var(--font-body);
  font-size: 14px;
}

/* ===== Mobile: off-canvas menu ===== */
@media (max-width: 1280px) {
  .nav-toggle { display: flex; }

  .header-end > .lang-switch { display: none; }

  .primary-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--paper-light);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.25);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 80px 32px 32px;
    z-index: 200;
    display: flex;
    flex-direction: column;
  }
  .primary-nav.is-open { transform: translateX(0); }

  .primary-nav ul {
    flex-direction: column;
    gap: 8px;
  }


  .lang-switch--menu {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 15px;
  }
  .lang-switch--menu a {
    flex: 1 1 calc(33.333% - 8px);
    text-align: center;
    padding: 8px 16px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
  }
  .lang-switch--menu a.is-active { border-color: var(--accent); }
  .primary-nav a {
    display: block;
    padding: 14px 0;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  .nav-close {
    display: block;
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 34px;
    line-height: 1;
    color: var(--ink);
    cursor: pointer;
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .nav-backdrop.is-visible { opacity: 1; }

  /* Animate hamburger into an X */
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
}
