/*
 * Declaration Digital Gift — Supplemental Styles
 * Place at: wp-content/themes/SBA/assets/declaration-gift.css
 *
 * Self-contained: all CSS variables defined here.
 * Fonts loaded via wp_enqueue_style('declaration-gift-fonts') in page-declaration-gift.php.
 * All class names are prefixed "dg-" to prevent collisions with theme styles.
 */

/* ── Design tokens ────────────────────────────────────────────────────────── */

:root {
  --dg-cream-50:  #FBF1D7;
  --dg-cream-100: #F5E9D0;
  --dg-cream-300: #E8D6A8;
  --dg-ink-900:   #1A1208;
  --dg-ink-700:   #2B1E10;
  --dg-ink-500:   #4A3520;
  --dg-navy:      #0F1B3D;
  --dg-red:       #B22234;
  --dg-font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --dg-font-serif:   'Cinzel', 'Times New Roman', serif;
  --dg-font-script:  'Tangerine', cursive;
  --dg-font-body:    'EB Garamond', Georgia, serif;
  --dg-ease:      cubic-bezier(.4, 0, .2, 1);
}

/* ── Page background ──────────────────────────────────────────────────────── */

.dg-page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, var(--dg-cream-50) 0%, var(--dg-cream-100) 50%, var(--dg-cream-300) 100%);
}

.dg-page-bg__fiber {
  position: absolute;
  inset: 0;
  filter: url(#paperFiber);
  opacity: .18;
  background: var(--dg-cream-100);
}

.dg-page-bg__grain {
  position: absolute;
  inset: 0;
  filter: url(#paperGrain);
  opacity: .10;
  background: var(--dg-cream-100);
}

/* ── Layout ───────────────────────────────────────────────────────────────── */

.dg-layout {
  display: flex;
  justify-content: center;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}

.dg-content-col {
  width: 100%;
  max-width: 960px;
  padding: clamp(2rem, 5vw, 3.5rem) 0 0;
}

/* ── Stars rule ───────────────────────────────────────────────────────────── */

.dg-stars-rule {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin: 1.75rem auto;
}

.dg-stars-rule--spaced {
  margin: 2.5rem auto;
}

.dg-stars-rule span {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--dg-navy);
  clip-path: polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
  opacity: .85;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.dg-hero {
  text-align: center;
  padding-bottom: 2rem;
}

.dg-hero__eyebrow {
  font-family: var(--dg-font-serif);
  font-weight: 500;
  font-size: .7rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--dg-red);
  margin: 0 0 1.5rem;
}

.dg-hero__title {
  font-family: var(--dg-font-display);
  font-weight: 700;
  margin: 0 0 1rem;
  line-height: .95;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--dg-navy);
}

.dg-hero__title-line {
  display: block;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
}

.dg-hero__title-line--accent {
  font-family: var(--dg-font-script);
  font-weight: 700;
  font-size: clamp(4rem, 8vw, 6.5rem);
  color: var(--dg-red);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1;
  margin-top: .3rem;
  display: inline-block;
  transform: rotate(-2deg);
}

.dg-hero__subtitle {
  font-family: var(--dg-font-display);
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--dg-ink-700);
  margin: 1.25rem auto 0;
  max-width: 50ch;
}

/* ── Parchment intro ──────────────────────────────────────────────────────── */

.dg-parchment {
  max-width: 720px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(248,241,224,.6) 0%, rgba(245,233,208,.3) 100%);
  border-top: 1px solid rgba(15,27,61,.15);
  border-bottom: 1px solid rgba(15,27,61,.15);
  padding: clamp(2rem, 4vw, 2.75rem) clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 2px;
  box-shadow: 0 4px 30px -10px rgba(20,10,2,.12);
  text-align: center;
}

.dg-parchment__dateline {
  font-family: var(--dg-font-serif);
  font-size: .8rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--dg-ink-700);
  margin: 0 0 .5rem;
}

.dg-parchment__heading {
  font-family: var(--dg-font-script);
  font-weight: 700;
  font-size: clamp(2.8rem, 5vw, 4rem);
  color: var(--dg-navy);
  margin: 0 0 1.5rem;
  line-height: 1;
}

.dg-parchment__ornament {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 80%;
  margin: 0 auto 2rem;
}

.dg-ornament-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(15,27,61,.4) 30%, rgba(15,27,61,.4) 70%, transparent);
}

.dg-parchment__body {
  font-family: var(--dg-font-serif);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--dg-ink-900);
  max-width: 56ch;
  margin: 0 auto;
  line-height: 1.65;
  text-align: left;
}

.dg-parchment__body p {
  margin: 0 0 1.4rem;
}

.dg-parchment__body p:last-child {
  margin-bottom: 0;
}

.dg-dropcap {
  font-family: var(--dg-font-script);
  font-weight: 700;
  font-size: 4.5em;
  float: left;
  line-height: .85;
  margin: .05em .3em 0 0;
  color: var(--dg-red);
}

.dg-parchment__call {
  font-family: var(--dg-font-script);
  text-align: center !important;
  font-size: 2rem;
  color: var(--dg-ink-700);
  margin-top: 1.75rem !important;
}

.dg-parchment__call em {
  color: var(--dg-red);
  font-weight: 700;
  font-style: normal;
}

/* ── Section shell ────────────────────────────────────────────────────────── */

.dg-section {
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3.5rem) 0;
  width: 100%;
}

.dg-section__header {
  text-align: center;
  margin-bottom: clamp(1.75rem, 3vw, 2.75rem);
  max-width: 720px;
  margin-inline: auto;
}

.dg-section__title {
  font-family: var(--dg-font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dg-navy);
  margin: 0 0 .75rem;
  line-height: 1.1;
}

.dg-section__subtitle {
  font-family: var(--dg-font-body);
  font-size: clamp(.95rem, 1.3vw, 1.05rem);
  color: var(--dg-ink-500);
  font-style: italic;
  max-width: 66ch;
  margin: 0 auto;
  line-height: 1.65;
}

/* ── Sub-section headings ─────────────────────────────────────────────────── */

.dg-subsection-title {
  font-family: var(--dg-font-serif);
  font-size: .75rem;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--dg-red);
  font-weight: 500;
  text-align: center;
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
}

.dg-subsection-title::before,
.dg-subsection-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(178,34,52,.35));
  max-width: 120px;
}

.dg-subsection-title::after {
  background: linear-gradient(90deg, rgba(178,34,52,.35), transparent);
}

.dg-subsection-title--spaced {
  margin-top: 2.75rem;
}

.dg-badge {
  display: inline-block;
  font-family: var(--dg-font-serif);
  font-size: .58rem;
  letter-spacing: .3em;
  padding: .15em .55em;
  border: 1px solid var(--dg-red);
  color: var(--dg-red);
  border-radius: 2px;
  vertical-align: middle;
}

/* ── Tier grid ────────────────────────────────────────────────────────────── */

.dg-tier-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3rem);
}

@media (min-width: 640px) {
  .dg-tier-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dg-tier-card {
  background: linear-gradient(170deg, rgba(248,241,224,.55) 0%, rgba(245,233,208,.2) 100%);
  border: 1px solid rgba(15,27,61,.12);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 28px -12px rgba(20,10,2,.14);
  transition: transform .3s var(--dg-ease), box-shadow .3s var(--dg-ease);
}

.dg-tier-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px -10px rgba(20,10,2,.2);
}

.dg-tier-card__image-wrap {
  width: 100%;
  background: var(--dg-cream-300);
}

.dg-tier-card__image {
  width: 100%;
  height: auto;
  display: block;
}

.dg-tier-card__body {
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: .85rem;
  flex: 1;
}

.dg-tier-card__label {
  font-family: var(--dg-font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dg-navy);
  margin: 0;
  line-height: 1.15;
}

.dg-tier-card__copy {
  font-family: var(--dg-font-body);
  font-size: clamp(.9rem, 1.2vw, 1rem);
  font-style: italic;
  color: var(--dg-ink-700);
  margin: 0;
  line-height: 1.7;
  flex: 1;
  border-left: 3px solid rgba(178,34,52,.3);
  padding-left: .85rem;
}

/* ── Wallpaper grid ───────────────────────────────────────────────────────── */

.dg-wallpaper-grid {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
}

.dg-wallpaper-grid--desktop {
  grid-template-columns: repeat(3, 1fr);
}

.dg-wallpaper-grid--phone {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 700px) {
  .dg-wallpaper-grid--desktop,
  .dg-wallpaper-grid--phone {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 480px) and (max-width: 700px) {
  .dg-wallpaper-grid--desktop,
  .dg-wallpaper-grid--phone {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dg-wallpaper-card {
  background: linear-gradient(170deg, rgba(248,241,224,.5) 0%, rgba(245,233,208,.15) 100%);
  border: 1px solid rgba(15,27,61,.1);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 18px -8px rgba(20,10,2,.12);
  transition: transform .3s var(--dg-ease), box-shadow .3s var(--dg-ease);
}

.dg-wallpaper-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -8px rgba(20,10,2,.18);
}

.dg-wallpaper-card:not(.dg-wallpaper-card--phone) .dg-wallpaper-card__image-wrap {
  aspect-ratio: 16 / 9;
}

.dg-wallpaper-card--phone .dg-wallpaper-card__image-wrap {
  aspect-ratio: 9 / 19;
}

.dg-wallpaper-card__image-wrap {
  width: 100%;
  overflow: hidden;
  position: relative;
  background: var(--dg-cream-300);
}

.dg-wallpaper-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s var(--dg-ease);
}

.dg-wallpaper-card:hover .dg-wallpaper-card__image {
  transform: scale(1.04);
}

.dg-wallpaper-card__badge {
  position: absolute;
  top: .5rem;
  right: .5rem;
  font-family: var(--dg-font-serif);
  font-size: .58rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  background: rgba(15,27,61,.72);
  color: rgba(245,233,208,.92);
  padding: .25em .65em;
  border-radius: 2px;
  backdrop-filter: blur(4px);
}

.dg-wallpaper-card__body {
  padding: .85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.dg-wallpaper-card__label {
  font-family: var(--dg-font-serif);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--dg-ink-700);
  margin: 0;
  font-weight: 500;
  line-height: 1.3;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.dg-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--dg-font-display);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 600;
  padding: .65em 1.35em;
  border-radius: 50px;
  text-decoration: none;
  transition: background .25s ease, color .25s ease, box-shadow .25s ease, transform .2s ease;
  white-space: nowrap;
  cursor: pointer;
  background: var(--dg-navy);
  color: rgba(245,233,208,.95);
  border: 1.5px solid var(--dg-navy);
  box-shadow: 0 2px 10px -4px rgba(15,27,61,.35);
}

.dg-btn:hover,
.dg-btn:focus-visible {
  background: var(--dg-red);
  border-color: var(--dg-red);
  box-shadow: 0 4px 18px -4px rgba(178,34,52,.4);
  transform: translateY(-1px);
  color: #fff;
}

.dg-btn svg {
  flex-shrink: 0;
}

.dg-btn--outline {
  background: transparent;
  color: var(--dg-navy);
  border-color: rgba(15,27,61,.35);
  box-shadow: none;
  font-size: .65rem;
  padding: .55em 1.1em;
}

.dg-btn--outline:hover,
.dg-btn--outline:focus-visible {
  background: var(--dg-navy);
  color: rgba(245,233,208,.95);
  border-color: var(--dg-navy);
  box-shadow: 0 3px 14px -4px rgba(15,27,61,.28);
}

.dg-btn--x {
  background: #000;
  border-color: #000;
  color: #fff;
  font-size: .78rem;
  padding: .75em 1.75em;
}

.dg-btn--x:hover,
.dg-btn--x:focus-visible {
  background: #222;
  border-color: #222;
  box-shadow: 0 4px 18px -4px rgba(0,0,0,.4);
  color: #fff;
}

.dg-btn--fb {
  background: #1877F2;
  border-color: #1877F2;
  color: #fff;
  font-size: .78rem;
  padding: .75em 1.75em;
}

.dg-btn--fb:hover,
.dg-btn--fb:focus-visible {
  background: #0d65d8;
  border-color: #0d65d8;
  box-shadow: 0 4px 18px -4px rgba(24,119,242,.45);
  color: #fff;
}

/* ── Share prompt ─────────────────────────────────────────────────────────── */

.dg-share-prompt {
  position: relative;
  margin: 1.5rem auto 0;
  max-width: 580px;
  padding: 3.5rem clamp(1.25rem, 3vw, 2.5rem) 2.5rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(15,27,61,.06) 0%, rgba(15,27,61,0) 100%);
  border-top: 1px solid rgba(15,27,61,.18);
  border-radius: 2px;
}

.dg-share-prompt__seal {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 72px;
  background: var(--dg-cream-50);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
  border: 1px solid rgba(15,27,61,.15);
}

.dg-share-prompt__title {
  font-family: var(--dg-font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dg-navy);
  margin: 0 0 .85rem;
}

.dg-share-prompt__copy {
  font-family: var(--dg-font-body);
  font-style: italic;
  color: var(--dg-ink-700);
  font-size: clamp(.92rem, 1.2vw, 1rem);
  line-height: 1.7;
  max-width: 50ch;
  margin: 0 auto 1.75rem;
}

.dg-share-btns {
  display: flex;
  gap: .875rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Colophon ─────────────────────────────────────────────────────────────── */

.dg-colophon {
  margin-top: 3rem;
  padding: 2.5rem 0 3rem;
  text-align: center;
  border-top: 1px solid rgba(15,27,61,.12);
}

.dg-colophon__logo {
  height: 48px;
  width: auto;
  margin: 0 auto 1rem;
  display: block;
}

.dg-colophon__tag {
  font-family: var(--dg-font-body);
  font-style: italic;
  font-size: 1rem;
  color: var(--dg-ink-700);
  margin: 0 0 .35rem;
}

.dg-colophon__meta {
  font-family: var(--dg-font-serif);
  font-size: .7rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--dg-ink-500);
  margin: 0;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 540px) {
  .dg-wallpaper-card__body {
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
  }
  .dg-share-btns {
    flex-direction: column;
    align-items: center;
  }
}
