/*
Theme Name: DAP Child
Description: Days After Pedagogy child theme.
Author: Days After Pedagogy
Template: twentytwentyone
Version: 1.2.0
Text Domain: dap-child
*/

/* ========== DAP Home ========== */

:root {
  --text:         #1a1a1a;
  --muted:        rgba(26,26,26,0.72);
  --border:       rgba(0,0,0,0.12);
  --border-strong:rgba(0,0,0,0.28);
  --panel:        #f5f0e8;          /* warm cream */
  --shadow:       0 12px 28px rgba(0,0,0,0.08);

  --navy:         #1e2d4e;          /* header / footer / titles */
  --navy-muted:   rgba(30,45,78,0.82);
  --accent:       #b84a32;          /* terracotta CTA / badges -- pulled from the book cover's brick */
  --accent-hover: #9a3a25;
  --warm:         #f9f5ef;          /* alternating section bg */
  --chalk:        #3d5c46;          /* chalkboard green -- pulled from the book cover, signature accent */

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Source Sans 3", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
                  "Apple Color Emoji", "Segoe UI Emoji";
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font-family: var(--font-body);
  line-height: 1.6;
}

h1, h2, h3,
.dap-brand__title,
.dap-hero__title,
.dap-section__title,
.dap-card__title,
.dap-post__title,
.dap-post-card__title,
.dap-panel__title,
.types-hero__title,
.tcard__title,
.dap-book .dap-section__title {
  font-family: var(--font-display);
  font-weight: 600;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.dap-home { min-height: 100vh; }

/* Skip link */
.dap-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 12px 14px;
  background: var(--navy);
  color: #fff;
  z-index: 9999;
}
.dap-skip-link:focus { left: 12px; top: 12px; }

/* ── Header / nav ── */
.dap-header {
  position: sticky;
  top: 0;
  background: var(--navy);
  z-index: 1000;
}
.dap-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.dap-brand__link {
  text-decoration: none;
  color: #fff;
  display: inline-block;
}
.dap-brand__title {
  display: block;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.dap-brand__subtitle {
  display: block;
  font-size: 0.88rem;
  opacity: 0.7;
}
.dap-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dap-nav__link {
  text-decoration: none;
  font-size: 0.92rem;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: rgba(255,255,255,0.88);
  transition: background 0.15s, border-color 0.15s;
}
.dap-nav__link:hover,
.dap-nav__link:focus-visible {
  border-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.08);
}
.dap-nav__link--cta {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}
.dap-nav__link--cta:hover,
.dap-nav__link--cta:focus-visible {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ── Hero ── */
.dap-hero {
  border-bottom: 1px solid rgba(0,0,0,0.08);
  background: linear-gradient(135deg, var(--warm) 0%, #fff 65%);
}
.dap-hero__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 18px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 32px;
  align-items: center;
}
.dap-hero__title {
  font-size: clamp(2rem, 3.1vw, 3rem);
  line-height: 1.1;
  margin: 0 0 14px 0;
  color: var(--navy);
}
.dap-hero__lede {
  font-size: 1.08rem;
  margin: 0 0 20px 0;
  max-width: 64ch;
  color: var(--muted);
}
.dap-hero__note {
  margin: 14px 0 0 0;
  font-size: 0.92rem;
  opacity: 0.78;
  max-width: 66ch;
}
.dap-hero__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* Buttons */
.dap-button {
  display: inline-block;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}
.dap-button:hover,
.dap-button:focus-visible {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.dap-button--secondary {
  background: transparent;
  color: var(--text);
  border-color: rgba(0,0,0,0.22);
}
.dap-button--secondary:hover,
.dap-button--secondary:focus-visible {
  background: transparent;
  border-color: rgba(0,0,0,0.44);
}

/* Book cover */
.dap-hero__graphic {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.dap-hero__img {
  width: 100% !important;
  max-width: 440px;
  /* WP core injects a bogus inline height:%; on this attachment (core bug,
     not ours) that stretches the image -- !important is needed to beat the
     inline style, which otherwise wins over any external stylesheet rule. */
  height: auto !important;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.14);
  object-fit: cover;
}

/* ── Sections ── */
.dap-section__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 18px;
}
.dap-section:nth-child(even) {
  background: var(--warm);
}
.dap-section__title {
  margin: 0 0 12px 0;
  font-size: 1.6rem;
  color: var(--navy);
}
.dap-section__text {
  margin: 0 0 14px 0;
  max-width: 68ch;
  color: var(--muted);
}
.dap-section__text strong {
  color: var(--text);
  font-weight: 700;
  background-image: linear-gradient(transparent 72%, rgba(61,92,70,0.22) 72%);
}

/* Callout */
.dap-callout {
  border: 1px solid rgba(184,74,50,0.2);
  border-left: 4px solid var(--accent);
  border-radius: 0 16px 16px 0;
  padding: 16px 20px;
  background: rgba(184,74,50,0.04);
}
.dap-callout__title {
  margin: 0 0 8px 0;
  font-size: 1.0rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dap-callout__list {
  margin: 0;
  padding-left: 18px;
}
.dap-callout__list li { margin: 8px 0; }

/* Cards / grids */
.dap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
  margin-top: 16px;
}
.dap-grid--three {
  grid-template-columns: repeat(3, minmax(0,1fr));
}
.dap-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.dap-card:hover,
.dap-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 16px 36px rgba(184,74,50,0.12);
  transform: translateY(-2px);
}

/* Card media area (image or icon placeholder) */
.dap-card__media {
  position: relative;
  margin: -18px -18px 16px -18px;
  height: 148px;
  border-radius: 15px 15px 0 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.75rem;
  background: var(--warm);
  background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.55), transparent 60%);
}
.dap-card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.06);
}
.dap-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Type-specific colors */
.dap-card--activity .dap-card__media  { background-color: #eef7f0; }
.dap-card--protocol .dap-card__media  { background-color: #fdf8ee; }
.dap-card--pdf      .dap-card__media  { background-color: #fdf0ee; }
.dap-card--video    .dap-card__media  { background-color: #eeeffe; }
.dap-card--link     .dap-card__media  { background-color: #f2eefe; }
.dap-card--reading  .dap-card__media  { background-color: #eef3fd; }

.dap-card__badge--activity { background: rgba(50,150,74,0.09);  color: #2d8a47; border-color: rgba(50,150,74,0.28); }
.dap-card__badge--protocol { background: rgba(150,130,50,0.09); color: #8a7228; border-color: rgba(150,130,50,0.28); }
.dap-card__badge--pdf      { background: rgba(184,74,50,0.09);  color: #b84a32; border-color: rgba(184,74,50,0.28); }
.dap-card__badge--video    { background: rgba(74,90,184,0.09);  color: #4a5ab8; border-color: rgba(74,90,184,0.28); }
.dap-card__badge--link     { background: rgba(120,74,184,0.09); color: #784ab8; border-color: rgba(120,74,184,0.28); }
.dap-card__badge--reading  { background: rgba(50,100,184,0.09); color: #3264b8; border-color: rgba(50,100,184,0.28); }

.dap-card__badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(184,74,50,0.3);
  background: rgba(184,74,50,0.08);
  color: var(--accent);
}
.dap-card__title {
  margin: 10px 0 6px 0;
  font-size: 1.02rem;
  color: var(--navy);
}
.dap-card__text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.dap-section__actions { margin-top: 18px; }
.dap-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.dap-link:hover { color: var(--accent-hover); }

/* Two-column resources */
.dap-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
  margin-top: 14px;
}

/* PDF embed */
.dap-pdf-col {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}
.dap-pdf {
  width: 100%;
  height: 500px;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.dap-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  background: #fff;
}
.dap-panel__title {
  margin: 0 0 10px 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--navy);
}
.dap-list {
  margin: 0;
  padding-left: 18px;
}
.dap-list li { margin: 8px 0; }
.dap-list a {
  color: var(--accent);
  text-underline-offset: 3px;
}
.dap-list a:hover { color: var(--accent-hover); }

/* Author block */
.dap-author {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 16px;
}
.dap-photo {
  width: 180px !important;
  height: 180px !important;
  border-radius: 50%;
  border: 3px solid rgba(184,74,50,0.2);
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}

/* Blog CTA -- distinct from the alternating cream/white rhythm so it reads
   as "the living, ongoing part of the site" rather than another theory section. */
section.dap-section.dap-section--blog-cta {
  background: var(--navy);
}
.dap-section--blog-cta .dap-section__title,
.dap-section--blog-cta .dap-section__text {
  color: #fff;
}
.dap-section--blog-cta .dap-section__text { opacity: 0.82; }

/* Footer */
.dap-footer {
  background: var(--navy);
  padding: 28px 0;
}
.dap-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.dap-footer .dap-link {
  color: rgba(255,255,255,0.8);
}
.dap-footer .dap-link:hover {
  color: #fff;
}
.dap-footer__fineprint {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.55);
}

/* ── Hamburger button (hidden on desktop) ── */
.dap-nav__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}
.dap-nav__icon--close               { display: none; }
.dap-nav__toggle[aria-expanded="true"] .dap-nav__icon--open  { display: none; }
.dap-nav__toggle[aria-expanded="true"] .dap-nav__icon--close { display: block; }

/* ── Tablet + mobile: hamburger nav, collapsed grids ── */
@media (max-width: 860px) {
  /* Show hamburger, hide nav links */
  .dap-nav__toggle {
    display: flex;
    background: var(--navy);
    background-color: var(--navy);
    -webkit-tap-highlight-color: transparent;
  }
  .dap-brand__subtitle { display: none; }

  .dap-header { position: relative; }

  .dap-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 2px;
    background: var(--navy);
    padding: 10px 16px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.22);
    z-index: 999;
  }
  .dap-nav.is-open { display: flex; }

  .dap-nav__link {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
  }
  .dap-nav__link--cta {
    margin-top: 6px;
    text-align: center;
  }

  /* Collapse grids */
  .dap-hero__inner   { grid-template-columns: 1fr; }
  .dap-hero__graphic { justify-content: center; }
  .dap-grid          { grid-template-columns: 1fr; }
  .dap-grid--three   { grid-template-columns: 1fr; }
  .dap-two-col       { grid-template-columns: 1fr; }
  .dap-author        { grid-template-columns: 1fr; }
  .dap-photo         { width: 140px !important; height: 140px !important; }
}

/* ── Small phones: tighter padding ── */
@media (max-width: 480px) {
  .dap-section__inner { padding: 28px 14px; }
  .dap-hero__inner    { padding: 32px 14px; }
  .dap-pdf            { height: 320px; }
  .dap-grid--buy      { grid-template-columns: 1fr; }
  .dap-photo          { width: 110px !important; height: 110px !important; }
}

/* ========== Blog ========== */

/* Blog listing: stacked post cards */
.dap-blog-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

.dap-post-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 24px 28px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.dap-post-card:hover,
.dap-post-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 16px 36px rgba(184,74,50,0.12);
  transform: translateY(-2px);
}

.dap-post-card__meta {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px 0;
}

.dap-post-card__title {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
  color: var(--navy);
  line-height: 1.3;
}

.dap-post-card__excerpt {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 78ch;
}

.dap-post-card__readmore {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Single post page */
.dap-post__header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
  margin-bottom: 28px;
}

.dap-post__meta {
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px 0;
}

.dap-post__title {
  margin: 0 0 0 0;
  font-size: clamp(1.6rem, 2.8vw, 2.4rem);
  line-height: 1.15;
  color: var(--navy);
}

.dap-post__body {
  max-width: 72ch;
}
.dap-post__body p {
  margin: 0 0 16px 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
}
.dap-post__body h2 {
  margin: 28px 0 10px 0;
  font-size: 1.3rem;
  color: var(--navy);
}
.dap-post__body h3 {
  margin: 20px 0 8px 0;
  font-size: 1.1rem;
  color: var(--navy);
}
.dap-post__body a {
  color: var(--accent);
  text-underline-offset: 3px;
}
.dap-post__body a:hover { color: var(--accent-hover); }
.dap-post__body ul,
.dap-post__body ol {
  padding-left: 22px;
  margin: 0 0 16px 0;
  color: var(--muted);
}
.dap-post__body li { margin: 6px 0; }

.dap-post__attribution {
  margin: 10px 0 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  font-style: italic;
}
.dap-post__attribution a {
  color: var(--accent);
  text-underline-offset: 3px;
}
.dap-post__attribution a:hover { color: var(--accent-hover); }

.dap-post__back {
  display: inline-block;
  margin-bottom: 28px;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.dap-post__back:hover { color: var(--accent-hover); }

/* Post attachments */
.dap-post__attachments {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  max-width: 72ch;
}

.dap-post__attachments-title {
  margin: 0 0 12px 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dap-post__attachments-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dap-post__attachments-list li {
  margin: 0;
}

.dap-post__attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 0.92rem;
}
.dap-post__attachment-link::before {
  content: '\2193';
  font-size: 0.8em;
  opacity: 0.7;
}
.dap-post__attachment-link:hover { color: var(--accent-hover); }

/* WordPress integration and archive layouts. */
.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;
}
.screen-reader-text:focus {
  width: auto;
  height: auto;
  clip: auto;
  padding: 12px;
  margin: 0;
  left: 12px;
  top: 12px;
  z-index: 100000;
  background: #fff;
}
.dap-nav ul,
.dap-nav li { display: contents; }
.dap-content-media { margin: 0 0 24px; }
.dap-content-media img { display: block; max-width: 100%; height: auto; }
.dap-empty { padding: 48px 0; }
.dap-pagination { margin-top: 32px; }
.dap-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 12px; }
.dap-pagination a,
.dap-pagination .current { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; }
.dap-resource-download { margin-top: 28px; }
.dap-resource-taxonomies { margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.dap-resource-taxonomies a { text-decoration: none; }
.dap-author__media:empty { display: none; }
.dap-books { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 48px; align-items: start; }
.dap-book { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 28px; align-items: center; }
.dap-book__cover { width: 100% !important; height: auto !important; border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.14); }
.dap-image-text { align-items: center; }
.dap-image-text .dap-content-media { margin: 0; }
.dap-image-text .dap-content-media img { width: 100%; border-radius: 8px; }

.types-hero { background: var(--navy); padding: 72px 18px 56px; text-align: center; }
.types-hero__eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; text-transform: uppercase; color: rgba(255,255,255,.55); margin-bottom: 16px; }
.types-hero__title { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 800; color: #fff; margin: 0 0 18px; line-height: 1.05; }
.types-hero__title em { font-style: normal; color: var(--accent); }
.types-hero__sub { max-width: 56ch; margin: 0 auto 32px; font-size: 1.05rem; color: rgba(255,255,255,.7); line-height: 1.6; }
.types-hero__back { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,.7); text-decoration: none; }
.types-bento-wrap { max-width: 1100px; margin: 0 auto; padding: 48px 18px 72px; }
.types-bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tcard { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 240px; border-radius: 8px; padding: 28px; text-decoration: none; color: #fff; overflow: hidden; background: var(--navy); transition: transform .2s, box-shadow .2s; }
.tcard:nth-child(3n+2) { background: #285b43; }
.tcard:nth-child(3n) { background: #623b68; }
.tcard:nth-child(4n) { background: #7c4529; }
.tcard:first-child, .tcard:nth-child(7) { grid-column: span 2; }
.tcard:last-child { grid-column: span 3; min-height: 160px; }
.tcard:hover, .tcard:focus-visible { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0,0,0,.25); }
.tcard__num { position: absolute; top: -10px; right: 16px; font-size: 8rem; font-weight: 900; line-height: 1; opacity: .1; }
.tcard__badge { display: inline-block; width: fit-content; font-size: .7rem; font-weight: 700; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25); margin-bottom: 10px; }
.tcard__title { color: #fff; font-size: 1.2rem; margin: 0 0 8px; }
.tcard__desc { color: rgba(255,255,255,.76); line-height: 1.5; margin: 0 0 16px; }
.tcard__arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

@media (max-width: 760px) {
  .types-bento { grid-template-columns: 1fr; }
  .tcard, .tcard:first-child, .tcard:nth-child(7), .tcard:last-child { grid-column: auto; min-height: 220px; }
  .dap-books, .dap-book { grid-template-columns: 1fr; }
  .dap-book__cover { max-width: 220px; }
}
