/* ==========================================================================
   BASE.CSS — Sagra San Giuseppe
   Core typography, containers, and utility classes.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Body
   -------------------------------------------------------------------------- */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--color-bark);
  background-color: var(--color-warm-white);
}

/* --------------------------------------------------------------------------
   2. Selection
   -------------------------------------------------------------------------- */
::selection {
  background-color: var(--color-primary-pale);
  color: var(--color-bark);
}

::-moz-selection {
  background-color: var(--color-primary-pale);
  color: var(--color-bark);
}

/* --------------------------------------------------------------------------
   3. Focus styles
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   4. Headings
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-soil);
  letter-spacing: var(--tracking-tight);
}

h1, .h1 {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-lg);
}

h2, .h2 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-lg);
}

h3, .h3 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-md);
}

h4, .h4 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-md);
}

h5, .h5 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
}

h6, .h6 {
  font-size: var(--text-md);
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-sm);
}

/* --------------------------------------------------------------------------
   5. Paragraphs & inline elements
   -------------------------------------------------------------------------- */
p {
  margin-bottom: var(--space-md);
  max-width: 70ch;
}

p:last-child {
  margin-bottom: 0;
}

strong, b {
  font-weight: var(--weight-bold);
  color: var(--color-soil);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
}

/* --------------------------------------------------------------------------
   6. Links
   -------------------------------------------------------------------------- */
a {
  color: var(--color-primary);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

/* Content links (inside prose/text) */
.content a,
.prose a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: var(--color-primary-pale);
  text-underline-offset: 3px;
  transition: color var(--transition-fast),
              text-decoration-color var(--transition-fast);
}

.content a:hover,
.prose a:hover {
  color: var(--color-primary-dark);
  text-decoration-color: var(--color-primary-dark);
}

/* --------------------------------------------------------------------------
   7. Blockquote
   -------------------------------------------------------------------------- */
blockquote {
  border-left: 3px solid var(--color-primary-light);
  padding-left: var(--space-lg);
  margin: var(--space-xl) 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--color-bark);
}

/* --------------------------------------------------------------------------
   8. Horizontal rule
   -------------------------------------------------------------------------- */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-primary-pale) 20%,
    var(--color-secondary-pale) 80%,
    transparent
  );
  margin: var(--space-2xl) 0;
}

/* --------------------------------------------------------------------------
   9. Images
   -------------------------------------------------------------------------- */
img {
  border-radius: var(--radius-md);
}

figure {
  margin: var(--space-xl) 0;
}

figcaption {
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-bark);
  opacity: 0.7;
  text-align: center;
}

/* --------------------------------------------------------------------------
   10. Containers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-default);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* --------------------------------------------------------------------------
   11. Screen-reader only
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only--focusable:focus,
.sr-only--focusable:active {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* --------------------------------------------------------------------------
   12. Text alignment utilities
   -------------------------------------------------------------------------- */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

/* --------------------------------------------------------------------------
   13. Text color utilities
   -------------------------------------------------------------------------- */
.text-primary {
  color: var(--color-primary);
}

.text-secondary {
  color: var(--color-secondary);
}

.text-accent {
  color: var(--color-accent);
}

.text-white {
  color: var(--color-white);
}

.text-muted {
  opacity: 0.7;
}
