/* Root Variables */
:root {
    --clr-bg: #F9F8F6;
    --clr-text: #33312E;
    --clr-text-light: #68645F;
    --clr-accent-primary: #B3367A;
    --clr-accent-secondary: #B77085;
    --clr-accent-subtle-bg: #F3E5E9; 
    --clr-border: #E0DDE2;
    --clr-error: #C73E1D;
    --font-heading: 'DM Serif Display', serif;
    --font-body: 'Inter', sans-serif;
}

/* Global Styles & Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 100%; }
body {
    background-color: var(--clr-bg);
    color: var(--clr-text);
    font-family: var(--font-body);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
::selection { background-color: var(--clr-accent-secondary); color: var(--clr-text); }
*:focus-visible { outline: 3px solid var(--clr-accent-primary); outline-offset: 4px; border-radius: 4px; }

/* Layout & Spacing */
.container { width: 90%; max-width: 720px; margin-inline: auto; }
section { padding-block: clamp(3rem, 10vh, 5rem); }
.section-divider { border: 0; height: 1px; background-color: var(--clr-border); margin: 2rem 0; }

/* Typography */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 400; line-height: 1.25; }
h1 { font-size: clamp(2.75rem, 6vw + 1rem, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw + 1rem, 3rem); margin-bottom: 2rem; border-bottom: 1px solid var(--clr-border); padding-bottom: 1rem; }
h3 { font-size: clamp(1.5rem, 2vw + 1rem, 2rem); margin-bottom: 1.5rem; }
h4 { font-size: 1.25rem; font-family: var(--font-body); font-weight: 700; margin-bottom: 1rem; }
p { max-width: 65ch; margin-bottom: 1.5rem; font-size: clamp(1rem, 1vw + 0.75rem, 1.125rem); }
a { color: var(--clr-accent-primary); text-decoration: underline; text-decoration-color: var(--clr-accent-secondary); text-underline-offset: 3px; transition: all 150ms ease; }
a:hover { text-decoration-color: var(--clr-accent-primary); }
strong { font-weight: 700; }
small, figcaption { font-size: 0.875rem; color: var(--clr-text-light); }
blockquote { margin: 2rem 0; padding-left: 1.5rem; border-left: 4px solid var(--clr-accent-primary); }
blockquote p { font-size: 1.25rem; font-style: italic; color: var(--clr-text-light); }
ul, ol { padding-left: 1.5rem; margin-bottom: 1.5rem; }
li { margin-bottom: 0.5rem; }

/* Site Header */
.site-header { padding: 1.5rem 0; border-bottom: 1px solid var(--clr-border); }
.site-header .container, .wordmark { display: flex; justify-content: space-between; align-items: center; }
.wordmark { gap: 0.75rem; text-decoration: none; color: var(--clr-text); }
.wordmark-text { font-family: var(--font-heading); font-size: 1.5rem; }
.primary-navigation ul { list-style: none; display: flex; gap: 1.5rem; }
.primary-navigation a {
    text-decoration: none;
    color: var(--clr-text);
    font-weight: 500;
    padding-bottom: 0.5rem;
    position: relative;
    transition: color 200ms ease;
}
.primary-navigation a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--clr-accent-secondary);
    transform: scaleX(0);
    transition: transform 250ms ease-in-out;
}
.primary-navigation a:hover::after, .primary-navigation a.active::after { transform: scaleX(1); }
.primary-navigation a:hover, .primary-navigation a.active { color: var(--clr-accent-primary); }

/* Site Footer */
.site-footer { padding: 3rem 0; text-align: center; color: var(--clr-text-light); border-top: 1px solid var(--clr-border); }

/* Component: Playful Rule */
.playful-rule { border: none; height: 6px; width: 30%; min-width: 150px; background-color: var(--clr-accent-primary); margin-inline: 0; margin-block: 1.5rem 2.5rem; transform: rotate(-1.5deg); }

/* Component: Buttons */
.button { display: inline-block; padding: 0.9em 1.8em; border-radius: 50px; font-weight: 500; text-decoration: none; border: 2px solid var(--clr-accent-primary); transition: all 200ms ease; cursor: pointer; }
.button-primary { background-color: var(--clr-accent-primary); color: var(--clr-bg); }
.button-primary:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }

/* Component: Images & Figures */
figure { margin: 2rem 0; }
figure img { width: 100%; height: auto; border-radius: 8px; }
figure figcaption { text-align: center; margin-top: 0.75rem; }
.img-circular { border-radius: 50%; aspect-ratio: 1/1; object-fit: cover; }
.img-float-right { float: right; width: 40%; min-width: 200px; margin-left: 1.5rem; margin-bottom: 1rem; }

/* Component: Forms */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.5rem; }
.form-group input, .form-group textarea { width: 100%; padding: 0.8rem 1rem; font-family: var(--font-body); font-size: 1rem; border-radius: 8px; border: 1px solid var(--clr-border); background-color: white; transition: all 200ms ease; }
.form-group input:focus-visible, .form-group textarea:focus-visible { border-color: var(--clr-accent-primary); box-shadow: 0 0 0 3px var(--clr-accent-secondary); outline: none; }
.form-group textarea { min-height: 150px; resize: vertical; }
.form-group.error label { color: var(--clr-error); }
.form-group.error input, .form-group.error textarea { border-color: var(--clr-error); }
.error-message { color: var(--clr-error); font-size: 0.875rem; margin-top: 0.25rem; display: block; }

/* Component: Alert Box */
.alert-box { background-color: white; border-left: 5px solid var(--clr-accent-secondary); padding: 1.5rem; border-radius: 0 8px 8px 0; margin: 2rem 0; }

/* Component: Accordion */
.accordion details { border-bottom: 1px solid var(--clr-border); padding: 1.5rem 0; }
.accordion summary { font-size: 1.25rem; font-weight: 500; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: '+'; font-size: 2rem; color: var(--clr-accent-secondary); transition: transform 200ms ease; }
.accordion details[open] summary::after { content: '−'; transform: rotate(180deg); }
.accordion .accordion-content { overflow: hidden; max-height: 0; transition: max-height 300ms ease-out; }
.accordion details[open] .accordion-content { padding-top: 1rem; max-height: 20rem; transition: max-height 500ms ease-in; }

/* Component: Cards */
.card-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card { position: relative; background-color: white; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); overflow: hidden; display: flex; flex-direction: column; transition: all 200ms ease; }
.card:hover, .card:focus-within { transform: translateY(-5px); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.card-image { width: 100%; height: 180px; object-fit: cover; }
.card-content { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.card-content h3 { margin-bottom: 0.5rem; }
.card-content h3 a { color: inherit; text-decoration: none; }
.card-content h3 a::after { content: ''; position: absolute; inset: 0; }
.card-content p { font-size: 1rem; margin-bottom: 1rem; color: var(--clr-text-light); }
.card-content .card-link { margin-top: auto; font-weight: 500; color: var(--clr-accent-primary); }

/* Component: Tags */
.tag {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.35em 1em; 
    border-radius: 50px;
    border: 1px solid transparent;
}

.tag-accent {
    background-color: var(--clr-accent-primary);
    color: var(--clr-bg);
}
.tag-neutral {
    background-color: var(--clr-text);
    color: var(--clr-bg);
}
.tag-subtle {
    background-color: var(--clr-accent-subtle-bg);
    color: var(--clr-accent-primary);
    border-color: var(--clr-accent-secondary);
}

/* ===================================================== */
/* Photo Credit (directly under image, closest to photo) */
/* ===================================================== */


/* ===================================================== */
/* 1) Tables */
/* ===================================================== */
.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.975rem;
}
.table :where(th, td) {
  padding: 0.875rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--clr-border);
}
.table thead th {
  background: var(--clr-accent-subtle-bg);
  color: var(--clr-text);
  font-weight: 600;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table-striped tbody tr:nth-child(even) { background: #faf9fb; }
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table caption {
  caption-side: bottom;
  padding: 0.5rem 0.25rem;
  color: var(--clr-text-light);
  font-size: 0.875rem;
}

/* ===================================================== */
/* 2) Definition Lists */
/* ===================================================== */
dl {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.5rem 1.25rem;
  padding: 1rem;
  background: white;
  border: 1px solid var(--clr-border);
  border-radius: 8px;
}
dt {
  font-weight: 600;
  color: var(--clr-text);
}
dd {
  margin: 0 0 0.5rem 0;
  color: var(--clr-text-light);
}
@media (max-width: 600px) {
  dl { grid-template-columns: 1fr; }
}

/* ===================================================== */
/* 4) Callouts (Info/Success/Warning/Error) */
/* ===================================================== */
.callout {
  position: relative;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--clr-border);
  display: grid;
  gap: 0.5rem;
}
.callout strong { display: block; }
.callout-info {
  border-left: 6px solid var(--clr-accent-secondary);
  background: var(--clr-accent-subtle-bg);
}
.callout-success {
  border-left: 6px solid #2f855a;
  background: #edf7f1;
}
.callout-warning {
  border-left: 6px solid #d69e2e;
  background: #fff8e6;
}
.callout-error {
  border-left: 6px solid var(--clr-error);
  background: #fdecea;
}

/* ===================================================== */
/* 9) Button Variants */
/* ===================================================== */
.button-secondary {
  background: var(--clr-accent-secondary);
  color: var(--clr-bg);
  border-color: var(--clr-accent-secondary);
}
.button-outline {
  background: transparent;
  color: var(--clr-accent-primary);
  border-color: var(--clr-accent-primary);
}
.button-outline:hover { background: var(--clr-accent-subtle-bg); }
.button-ghost {
  background: transparent;
  color: var(--clr-text);
  border-color: transparent;
}
.button-ghost:hover { background: #f1eff3; }
.button-sm { padding: 0.6em 1em; font-size: 0.9rem; }
.button-lg { padding: 1.1em 2em; font-size: 1.05rem; }
.button[disabled], .button.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===================================================== */
/* 11) Alerts (variants) */
/* ===================================================== */
.alert {
  background: white;
  border: 1px solid var(--clr-border);
  border-left-width: 6px;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  margin: 1.25rem 0;
}
.alert p { margin: 0.25rem 0 0 0; color: var(--clr-text-light); }
.alert strong { color: var(--clr-text); }
.alert-info {
  border-left-color: var(--clr-accent-secondary);
  background: var(--clr-accent-subtle-bg);
}
.alert-success {
  border-left-color: #2f855a;
  background: #edf7f1;
}
.alert-warning {
  border-left-color: #d69e2e;
  background: #fff8e6;
}
.alert-error {
  border-left-color: var(--clr-error);
  background: #fdecea;
}

/* ===================================================== */
/* Photo Credit (directly under image, right aligned) */
/* ===================================================== */

/* ===================================================== */
/* Photo Credit (refined design: smaller, italic, subtle) */
/* ===================================================== */
figure .photo-credit {
  display: block;
  font-size: 0.7rem;          /* smaller than figcaption */
  font-style: italic;         /* traditional credit style */
  color: var(--clr-text-light);
  margin-top: 0.25rem;        /* sits snug under image */
  text-align: right;          /* right aligned, off the content flow */
  opacity: 0.8;               /* visually lighter */
  letter-spacing: 0.3px;      /* slight typographic distinction */
}

figure .photo-credit a {
  color: inherit;             /* matches subtle text */
  text-decoration: none;      /* no underline by default */
}

figure .photo-credit a:hover {
  text-decoration: underline; /* reveal underline on hover */
}

/* ===================================================== */
/* Photo Credit (for circular images, lighter & centered) */
/* ===================================================== */
figure .img-circular + .photo-credit {
  font-size: 0.65rem;      /* slightly smaller */
  font-style: italic;
  color: var(--clr-text-light);
  margin-top: 0.15rem;     /* very snug under circular photo */
  text-align: center;      /* centered looks best under round images */
  opacity: 0.7;            /* even lighter */
}

figure .img-circular + .photo-credit a {
  color: inherit;
  text-decoration: none;
}

figure .img-circular + .photo-credit a:hover {
  text-decoration: underline;
}

.footer-navigation ul {
  display: flex;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0 0 .5rem 0;
}
.footer-navigation a { text-decoration: none; }
