/*
Theme Name: Holly R. Henry Portfolio
Author: Holly R. Henry
Description: Stable, extensible portfolio theme with density-aware typography
Version: 3.0
*/

/* =========================
   Design Tokens
   ========================= */

:root {
  --brand-red: #bf1313;
  --brand-red-dark: #5d1a07;

  --text-primary: #171717;
  --text-secondary: #5f5f5f;

  --bg-light: #e9e8e9;
  --white: #ffffff;

  /* Readable measures */
  --measure-default: 68ch;   /* general reading */
  --measure-wide: 80ch;     /* dense case pages */

  /* Gutters */
  --gutter-desktop: 80px;
  --gutter-tablet: 48px;
  --gutter-mobile: 24px;
  --gutter: var(--gutter-desktop);
}

/* =========================
   Reset & Base Typography
   ========================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background-color: var(--white);
  line-height: 1.55;
}

/* Global link styling (site-wide invariant). */
a {
  color: var(--brand-red-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:visited {
  color: var(--brand-red-dark);
}

p {
  font-size: 19px;
  margin-bottom: 24px;
  max-width: var(--measure-default);
}

h1, h2, h3 {
  font-weight: 500;
}

h1 {
  font-size: 40px;
  letter-spacing: 0.02em;
  margin-bottom: 32px;
}

h2 {
  font-size: 28px;
  margin: 2.5rem 0 1rem;
}

h3 {
  font-size: 19px;
  margin-bottom: 12px;
}

/* Home page REAL initial letters */
.real-letter {
  color: var(--brand-red);
  font-size: 24px;
  font-weight: 600;
}

/* =========================
   Global Layout
   ========================= */

main#site-content {
  max-width: 1440px;
  margin: 0 auto;
}

section {
  padding: 80px var(--gutter);
}

.section-light {
  background-color: var(--bg-light);
}


/* Shared page containers: keep consistent left/right gutters everywhere.
   (Do NOT put reading-measure constraints here; those belong on text blocks.) */
.page-main,
.page-content,
.content-inner,
.case-library-inner,
.case-detail,
main.single-case {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Page.php: prevent double-gutter indentation inside .content-inner */
.page-content {
  padding-left: 0;
  padding-right: 0;
}

/* Page.php: treat everything after the intro paragraph as "inventory" */
.page-content > :not(p:first-of-type) {
  margin-left: 1.5rem;
}


/* =========================
   Homepage
   ========================= */

.hero {
  padding-top: 120px;
  padding-bottom: 80px;
}

/* Front-page.php uses <img class="brand-mark"> (not a wrapper). Support both. */
img.brand-mark,
.brand-mark img {
  width: 56px;
  height: auto;
  display: block;
}

.brand-name {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.brand-tagline {
  font-size: 18px;
  color: var(--brand-red-dark);
}

/* Selected Work (homepage) */

.case {
  margin-top: 64px;
}

.case h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.case .context {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.case-link {
  font-size: 14px;
  color: var(--brand-red);
  text-decoration: none;
}

.case-link:hover {
  text-decoration: underline;
}

/* REAL framework */

.real-framework {
  background-color: var(--bg-light);
}

.real-framework-intro {
  margin-bottom: 48px;
}

.real-framework-intro p {
  max-width: var(--measure-default);
}

/* --- Flip tile grid --- */

.real-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 40px;
}



.real-tile {
  perspective: 800px;
  position: relative;
}

.tile-toggle {
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  pointer-events: none;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
}

.tile-card {
  display: block;
  position: relative;
  width: 100%;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

.tile-toggle:checked + .tile-card {
  transform: rotateY(180deg);
}

.tile-front,
.tile-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid #d4d4d4;
  border-radius: 4px;
  padding: 28px 24px 40px 24px !important;
  background: var(--white, #ffffff);
  box-sizing: border-box !important;
}

.tile-front {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.tile-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 28px 24px 40px 24px !important;
}

.tile-front .real-letter {
  color: var(--brand-red, #8b1a1a);
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 4px;
}

.tile-front h3 {
  font-size: 19px;
  font-weight: 500;
  margin-bottom: 10px;
}

.tile-front p {
  font-size: 15px;
  color: var(--text-secondary, #555);
  margin-bottom: 0;
  max-width: none;
  line-height: 1.45;
}

.tile-back p {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 12px;
  max-width: none;
}

.tile-back .real-question {
  font-style: italic;
  font-size: 14px;
  color: var(--text-secondary, #555);
  margin-top: 4px;
  margin-bottom: 0;
}

.tile-flip-icon {
  position: absolute;
  bottom: 10px;
  right: 14px;
  width: 18px !important;
  height: 18px !important;
  max-width: 18px;
  max-height: 18px;
  opacity: 0.35;
  transition: opacity 0.2s ease;
  pointer-events: none;
  display: block;
}

.tile-card:hover .tile-flip-icon {
  opacity: 0.6;
}

/* Attribution below tile grid */
.real-attribution {
  margin-top: 48px;
  font-size: 15px;
  color: var(--text-secondary, #555);
  max-width: var(--measure-default);
  font-style: italic;
}

/* Selected Work intro paragraph */
.selected-work-intro {
  max-width: var(--measure-default);
  margin-bottom: 32px;
}

/* REAL tags on case pages */
.case-real-tags {
  font-size: 14px;
  font-style: italic;
  color: var(--text-secondary, #555);
  margin-bottom: 24px;
}

/* REAL framework responsive */
@media (max-width: 1024px) {
  .real-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .real-grid {
    grid-template-columns: 1fr;
  }
}



/* =========================
   Case Pages (Density-aware)
   ========================= */

body.single-case .case-detail {
  max-width: var(--measure-wide);
}

.case-title {
  font-size: 36px;
  margin-bottom: 12px;
}

.case-context {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.case-body p:first-of-type {
  line-height: 1.7;
  margin-bottom: 32px;
}

.case-body h3 {
  font-size: 19px;
  font-weight: 300;
  margin-top: 36px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.case-body h3::after {
  content: "";
  flex-grow: 1;
  height: 1px;
  background-color: var(--bg-light);
}

/* =========================
   Static Pages
   ========================= */

.page-title {
  font-size: 36px;
  margin-bottom: 32px;
}

.page-content > p:first-of-type {
  margin-bottom: 40px;
}

/* Normalize list indentation inside page.php inventory content */
.page-content ul {
    padding-left: 0;
    margin-left: 0;
}

.page-content ul li {
    margin-left: 1.5rem;
}


/* =========================
   Publications
   ========================= */

body.page .pub-entry {
  margin-bottom: 1.75rem;
}

.pub-authors {
  font-weight: 500;
}

.pub-title {
  font-style: italic;
  margin: 0.15rem 0;
}

.pub-title a {
  color: var(--brand-red);
  text-decoration: none;
}

.pub-title a:hover {
  text-decoration: underline;
}

.pub-venue {
  font-size: 0.95em;
  color: #555;
}

/* =========================
   Lists
   ========================= */

.page-content ul {
  margin: 0 0 2rem 1.25rem;
  max-width: var(--measure-default);
}

.page-content li {
  margin-bottom: 0.75rem;
  font-size: 19px;
  line-height: 1.55;
}

/* =========================
   Case Library
   ========================= */

.case-library-entry {
    margin-left: 1.5rem;
}

.case-library-entry {
  margin-bottom: 2rem;
}

.case-library-entry h2 {
    font-size: 1.35rem;
    line-height: 1.3;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    text-decoration: none;
}


.case-library-title a:hover {
  text-decoration: underline;
}

.case-library-context {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
  margin-bottom: 0.4rem;
}

.case-library-decision {
  margin-top: 0;
  margin-bottom: 0.75rem;
  line-height: 1.45;
}

/* =========================
   Footer
   ========================= */

.site-footer {
  margin-top: 80px;
}

.footer-inner {
 /* max-width: var(--measure-default); */
  margin: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.footer-cred-links {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.footer-cred-links a {
  color: var(--brand-red-dark);
  text-decoration: none;
}

.footer-cred-links a:hover {
  text-decoration: underline;
}

.footer-separator {
  margin: 0 0.25em;
  color: var(--text-secondary);
}

.footer-link.inactive {
  color: var(--text-secondary);
  cursor: default;
}

/* "Selected Work" backlink shown at the end of pages (and cases). 
.case-backlink {
  margin-top: 48px;
  margin-bottom: 0;
}

.case-backlink a {
  color: var(--brand-red-dark);
  text-decoration: none;
}

.case-backlink a:hover {
  text-decoration: underline;
}

Case pages get wider footer to align vertically 
body.single-case .footer-inner {
  max-width: var(--measure-wide);
  padding-left: 100px;
  padding-right: 100px;
} */

/* =========================
   Authorship Mark
   ========================= */

.authorship-mark {
  position: fixed;
  right: 24px;
  bottom: 24px;
  opacity: 0.75;
  pointer-events: none;
  z-index: 10;
}

.authorship-mark img {
  height: 18px;
  width: auto;
}

/* =========================
   Mobile Typography & Spacing Overrides
   ========================= */

@media (max-width: 768px) {

  :root {
    --gutter: var(--gutter-mobile);
  }


  /* ---- Global text ---- */

  body {
    font-size: 16px;
    line-height: 1.5;
  }

  p {
    font-size: 16px;
    margin-bottom: 16px;
  }

  /* ---- Headings ---- */

  h1 {
    font-size: 28px;
    margin-bottom: 24px;
  }

  h2 {
    font-size: 22px;
    margin-bottom: 20px;
  }

  h3 {
    font-size: 17px;
    margin-bottom: 16px;
  }

  /* ---- Global section padding ---- */

  section {
    padding: 48px var(--gutter);
  }
  
    /* ---- Hero exception (mobile) ---- */
  .hero {
    padding: 120px var(--gutter) 80px;
  }

  /* ---- Static pages (page.php) ---- */

  .content-page {
    padding: 64px var(--gutter) 56px;
  }

  .page-title {
    font-size: 28px;
  }

  .page-content > p:first-of-type {
    font-size: 17px;
    line-height: 1.6;
    margin-bottom: 24px;
  }

  .page-content li {
    font-size: 16px;
    padding-left: 20px;
    margin-bottom: 8px;
  }

  /* ---- Case pages (single-case.php) ---- */

  .case-detail {
    padding: 64px var(--gutter) 56px;
  }

  .case-title {
    font-size: 28px;
  }

  .case-context {
    font-size: 14px;
  }

  .case-body p {
    font-size: 16px;
    line-height: 1.55;
  }

  .case-body h3 {
    font-size: 17px;
    margin-top: 28px;
  }

  .case-return {
    margin-top: 40px;
  }

}

/* =========================
   Responsive Tightening
   ========================= */

@media (max-width: 1024px) {
  :root {
    --gutter: var(--gutter-tablet);
  }

  section {
    padding: 64px var(--gutter);
  }

  body.single-case .footer-inner {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }
}

@media (max-width: 768px) {
  :root {
    --gutter: var(--gutter-mobile);
  }

  section {
    padding: 48px calc(var(--gutter) + 32px) 48px var(--gutter);
  } 

  /* Ensure a right gutter remains even with the fixed authorship mark. */
  .page-main,
  .case-library-inner,
  .case-detail,
  .footer-inner {
    padding-left: var(--gutter);
    padding-right: calc(var(--gutter) + 32px);
  }

  body.single-case .footer-inner {
    padding-left: var(--gutter);
    padding-right: calc(var(--gutter) + 32px);
  }

  .real-grid {
    grid-template-columns: 1fr;
  }
}

/* === EOF sanity marker === */
