/*
Theme Name: The Better Fit
Theme URI: https://thebetterfit.com
Author: Allena Rissa
Author URI: https://thebetterfit.com
Description: Editorial fashion theme for The Better Fit. Outfit ideas for you, your guy, and your family. Pinterest-first, display-ad-friendly, no affiliate dependencies.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: thebetterfit
Tags: editorial, fashion, magazine, pinterest, blog
*/

/* ===== CSS VARIABLES ===== */
:root {
  --cream: #FAF6EE;
  --cream-2: #F2EBDD;
  --bone: #EFE6D2;
  --warm-divider: #E2DACA;
  --sand: #BFA888;
  --olive: #6B6147;
  --olive-soft: #8B8268;
  --terracotta: #8B3A2E;
  --terracotta-soft: #B5614F;
  --type-primary: #1A1814;
  --type-secondary: #4D4538;
  --type-muted: #756B58;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Newsreader', Georgia, serif;
  font-variation-settings: 'opsz' 14;
  background: var(--cream);
  color: var(--type-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(139, 58, 46, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(107, 97, 71, 0.025) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

/* ===== TYPOGRAPHY HELPERS ===== */
.display {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.label {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 9;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--olive);
}

/* ===== TOP NAV ===== */
.site-header {
  border-bottom: 1px solid var(--warm-divider);
  padding: 1.1rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 96, 'SOFT' 100;
  font-weight: 500;
  font-size: 1.55rem;
  letter-spacing: -0.025em;
  color: var(--type-primary);
  text-decoration: none;
}

.logo em {
  font-style: italic;
  font-variation-settings: 'opsz' 96, 'SOFT' 100;
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 2.2rem;
  list-style: none;
}

.nav-links a {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 14;
  font-weight: 450;
  font-size: 0.95rem;
  color: var(--type-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--terracotta); }

.search-btn {
  background: none;
  border: 1px solid var(--warm-divider);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-family: 'Newsreader', serif;
  font-size: 0.85rem;
  color: var(--type-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.search-btn:hover { border-color: var(--olive); color: var(--olive); }

/* ===== HERO ===== */
.hero {
  padding: 5rem 2.5rem 4rem;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-text .label { margin-bottom: 1.8rem; display: block; }

.hero-headline {
  font-size: clamp(2.8rem, 5.2vw, 4.6rem);
  margin-bottom: 1.6rem;
  color: var(--type-primary);
}

.hero-headline em {
  font-style: italic;
  color: var(--terracotta);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}

.hero-sub {
  font-family: 'Newsreader', Georgia, serif;
  font-variation-settings: 'opsz' 24;
  font-size: 1.18rem;
  color: var(--type-secondary);
  margin-bottom: 2rem;
  max-width: 30em;
  line-height: 1.5;
}

.hero-credit {
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  color: var(--type-muted);
  font-size: 0.98rem;
  border-top: 1px solid var(--warm-divider);
  padding-top: 1.4rem;
  max-width: 28em;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 220px 180px;
  gap: 0.8rem;
}

.hero-tile {
  border-radius: 4px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: var(--cream);
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 24, 'SOFT' 100;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.25;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
  text-decoration: none;
  background-color: var(--olive);
  background-size: cover;
  background-position: center;
}

.hero-tile:hover { transform: translateY(-3px); }

.hero-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.55) 100%);
}

.hero-tile span { position: relative; z-index: 1; }

.hero-tile.tile-1 {
  background-color: #8B3A2E;
  background-image: linear-gradient(135deg, #6B3A2A 0%, #8B3A2E 60%, #9B4F36 100%);
  grid-row: 1 / 3;
}
.hero-tile.tile-2 {
  background-color: #6B6147;
  background-image: linear-gradient(160deg, #4A4530 0%, #6B6147 70%, #8B8268 100%);
}
.hero-tile.tile-3 {
  background-color: #BFA888;
  background-image: linear-gradient(145deg, #BFA888 0%, #A89373 60%, #8B7B5E 100%);
}

.hero-tile.has-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--tile-bg);
  background-size: cover;
  background-position: center;
}

/* ===== SECTIONS ===== */
.section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 4.5rem 2.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2.8rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--warm-divider);
}

.section-header h2 {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 72, 'SOFT' 100;
  font-weight: 400;
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  color: var(--type-primary);
  letter-spacing: -0.02em;
}

.section-header h2 em {
  font-style: italic;
  color: var(--terracotta);
}

.section-link {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 9;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  color: var(--olive);
  text-decoration: none;
  border-bottom: 1px solid var(--olive);
  padding-bottom: 2px;
}

.section-link:hover { color: var(--terracotta); border-color: var(--terracotta); }

/* ===== ARTICLE CARDS ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.card {
  cursor: pointer;
  transition: transform 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover { transform: translateY(-4px); }

.card-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 3px;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
  background-color: var(--olive);
  background-size: cover;
  background-position: center;
}

.card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.25) 100%);
}

/* Card image fallback gradients (used when no featured image set) */
.card-image.fallback-1 { background-image: linear-gradient(155deg, #7A2B22 0%, #5C2018 100%); }
.card-image.fallback-2 { background-image: linear-gradient(155deg, #9C5840 0%, #7C3F2C 100%); }
.card-image.fallback-3 { background-image: linear-gradient(155deg, #6B6147 0%, #4D4530 100%); }
.card-image.fallback-4 { background-image: linear-gradient(155deg, #D8C8A8 0%, #BFA888 100%); }
.card-image.fallback-5 { background-image: linear-gradient(155deg, #4F3826 0%, #2E1F13 100%); }
.card-image.fallback-6 { background-image: linear-gradient(155deg, #3B4A36 0%, #233121 100%); }
.card-image.fallback-7 { background-image: linear-gradient(155deg, #5C3851 0%, #3D2235 100%); }
.card-image.fallback-8 { background-image: linear-gradient(155deg, #2B3340 0%, #1A1F26 100%); }

.card-meta {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 9;
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--olive);
  margin-bottom: 0.5rem;
}

.card h3 {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 36, 'SOFT' 100;
  font-weight: 450;
  font-size: 1.18rem;
  line-height: 1.25;
  color: var(--type-primary);
  letter-spacing: -0.01em;
}

/* ===== PILLARS SECTION ===== */
.pillars-section {
  background: var(--cream-2);
  padding-top: 5.5rem;
  padding-bottom: 5.5rem;
  margin: 2rem 0;
}

.pillars-section .section-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

.pillars-intro {
  max-width: 32em;
  margin-bottom: 3.5rem;
}

.pillars-intro .label { margin-bottom: 1.2rem; display: block; }

.pillars-intro h2 {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 72, 'SOFT' 100;
  font-weight: 400;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.2;
  color: var(--type-primary);
  letter-spacing: -0.015em;
}

.pillars-intro h2 em {
  font-style: italic;
  color: var(--terracotta);
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.2rem;
}

.pillar-card {
  background: var(--cream);
  border: 1px solid var(--warm-divider);
  border-radius: 4px;
  padding: 1.8rem 1.5rem 1.6rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  text-decoration: none;
  color: inherit;
}

.pillar-card:hover {
  border-color: var(--terracotta);
  transform: translateY(-3px);
}

.pillar-number {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  font-weight: 300;
  font-style: italic;
  font-size: 2.2rem;
  color: var(--terracotta);
  line-height: 1;
  margin-bottom: 1.2rem;
}

.pillar-card h3 {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 36, 'SOFT' 100;
  font-weight: 450;
  font-size: 1.3rem;
  color: var(--type-primary);
  letter-spacing: -0.01em;
}

.pillar-card p {
  font-family: 'Newsreader', serif;
  font-size: 0.92rem;
  color: var(--type-secondary);
  line-height: 1.5;
}

/* ===== ABOUT ALLENA ===== */
.about {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 4rem;
  align-items: center;
  padding: 6rem 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.about-image {
  aspect-ratio: 4 / 5;
  background:
    linear-gradient(180deg, transparent 50%, rgba(26, 24, 20, 0.2) 100%),
    linear-gradient(135deg, #B5614F 0%, #8B3A2E 50%, #6B2B22 100%);
  background-size: cover;
  background-position: center;
  border-radius: 3px;
  max-width: 380px;
  position: relative;
}

.about-text .label { margin-bottom: 1.5rem; display: block; }

.about-text h2 {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 96, 'SOFT' 100;
  font-weight: 400;
  font-size: clamp(2rem, 3.6vw, 2.8rem);
  color: var(--type-primary);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1.8rem;
}

.about-text h2 em {
  font-style: italic;
  color: var(--terracotta);
}

.about-text p {
  font-family: 'Newsreader', serif;
  font-variation-settings: 'opsz' 24;
  font-size: 1.1rem;
  color: var(--type-secondary);
  margin-bottom: 1.1rem;
  line-height: 1.6;
}

.about-link {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 9;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: var(--terracotta);
  text-decoration: none;
  border-bottom: 1px solid var(--terracotta);
  padding-bottom: 3px;
  display: inline-block;
  margin-top: 1rem;
}

/* ===== EDITORIAL QUOTE ===== */
.editorial {
  background: var(--type-primary);
  color: var(--cream);
  padding: 6.5rem 2.5rem;
  margin: 3rem 0;
}

.editorial-inner {
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}

.editorial .label {
  color: var(--terracotta-soft);
  margin-bottom: 2rem;
  display: inline-block;
}

.editorial-quote {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.8rem, 3.4vw, 2.7rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--cream);
}

.editorial-quote span { color: var(--terracotta-soft); font-style: italic; }

.editorial-attribution {
  font-family: 'Newsreader', serif;
  margin-top: 2.2rem;
  color: var(--bone);
  opacity: 0.7;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--cream-2);
  padding: 5rem 2.5rem 2.5rem;
  margin-top: 3rem;
  border-top: 1px solid var(--warm-divider);
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3.5rem;
  border-bottom: 1px solid var(--warm-divider);
}

.footer-brand .logo {
  margin-bottom: 1rem;
  display: block;
}

.footer-brand p {
  font-family: 'Newsreader', serif;
  font-size: 0.95rem;
  color: var(--type-secondary);
  margin-bottom: 1.3rem;
  max-width: 22em;
  line-height: 1.55;
}

.footer-col h4 {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 9;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--olive);
  margin-bottom: 1.2rem;
}

.footer-col ul { list-style: none; }

.footer-col li {
  margin-bottom: 0.6rem;
  font-family: 'Newsreader', serif;
  font-size: 0.95rem;
}

.footer-col a {
  color: var(--type-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--terracotta); }

.footer-bottom {
  max-width: 1400px;
  margin: 2rem auto 0;
  display: flex;
  justify-content: space-between;
  font-family: 'Newsreader', serif;
  font-size: 0.85rem;
  color: var(--type-muted);
}

/* ===== GENERIC PAGE & ARTICLE LAYOUTS ===== */
.content-area {
  max-width: 720px;
  margin: 0 auto;
  padding: 4rem 2rem 5rem;
}

.entry-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--warm-divider);
}

.entry-meta {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 9;
  font-weight: 500;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--olive);
  margin-bottom: 1rem;
}

.entry-title {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  font-weight: 400;
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--type-primary);
  margin-bottom: 1rem;
}

.entry-byline {
  font-family: 'Newsreader', serif;
  font-style: italic;
  color: var(--type-muted);
  font-size: 1rem;
}

.entry-content {
  font-family: 'Newsreader', Georgia, serif;
  font-variation-settings: 'opsz' 24;
  font-size: 1.18rem;
  line-height: 1.75;
  color: var(--type-secondary);
}

.entry-content h2 {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 72, 'SOFT' 100;
  font-weight: 450;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--type-primary);
  margin: 3rem 0 1.4rem;
}

.entry-content h3 {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 36, 'SOFT' 100;
  font-weight: 500;
  font-size: 1.45rem;
  line-height: 1.3;
  color: var(--type-primary);
  margin: 2.4rem 0 1rem;
}

.entry-content p { margin-bottom: 1.4rem; }
.entry-content a { color: var(--terracotta); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.entry-content a:hover { color: var(--type-primary); }
.entry-content img { margin: 2rem 0; border-radius: 3px; }
.entry-content blockquote {
  border-left: 3px solid var(--terracotta);
  padding-left: 1.4rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--type-primary);
  font-size: 1.25rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-text > * { animation: fadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
.hero-text .label { animation-delay: 0.05s; }
.hero-text h1 { animation-delay: 0.15s; }
.hero-sub { animation-delay: 0.3s; }
.hero-credit { animation-delay: 0.45s; }

.hero-tile { animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
.hero-tile.tile-1 { animation-delay: 0.4s; }
.hero-tile.tile-2 { animation-delay: 0.55s; }
.hero-tile.tile-3 { animation-delay: 0.7s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1000px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 3rem 1.5rem 2rem;
  }
  .hero-grid { grid-template-rows: 180px 140px; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
  .pillars-grid { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; padding: 4rem 1.5rem; gap: 2.5rem; }
  .about-image { max-width: 100%; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .section { padding: 3.5rem 1.5rem; }
  .site-header { padding: 1rem 1.5rem; }
  .nav-links { display: none; }
  .content-area { padding: 2.5rem 1.5rem 3.5rem; }
}

@media (max-width: 600px) {
  .cards-grid { grid-template-columns: 1fr; }
  .pillars-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
  .footer-bottom { flex-direction: column; gap: 0.8rem; }
}

/* ===== WORDPRESS REQUIRED CLASSES ===== */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.9rem; color: var(--type-muted); font-style: italic; margin-top: 0.5rem; }
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}
