/* Base Styles — Casa Penyes */

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-normal);
  color: var(--color-charcoal);
  background-color: var(--color-warm-white);
  line-height: 1.65;
}

/* Grain texture overlay on body */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-normal);
  line-height: 1.15;
  color: var(--color-deep-blue);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p {
  max-width: 65ch;
  margin-bottom: 1em;
}

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

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

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

a:focus-visible {
  outline: 2px solid var(--color-terracotta);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Section label — editorial numbered labels */
.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--section-text-muted, var(--color-charcoal));
  opacity: 0.6;
  margin-bottom: var(--space-sm);
}

/* Section heading with accent underline */
.section-heading {
  position: relative;
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-md);
}

.section-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--section-accent, var(--color-terracotta));
  border-radius: var(--radius-full);
}

.section-heading--center {
  text-align: center;
}

.section-heading--center::after {
  left: 50%;
  transform: translateX(-50%);
}

/* Body text sizes */
.text-lg {
  font-size: var(--fs-body-lg);
  line-height: 1.7;
}

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

.text-muted {
  color: var(--section-text-muted, rgba(44, 44, 44, 0.6));
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

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

/* Section */
.section {
  padding-block: var(--space-xl);
  background-color: var(--section-bg, var(--color-warm-white));
  color: var(--section-text, var(--color-charcoal));
  position: relative;
  overflow: hidden;
}

.section--hero {
  padding-block: 0;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section--full {
  padding-block: var(--space-2xl);
}

/* Themed section headings inherit color */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 {
  color: var(--color-warm-white);
}

[data-theme="accent"] h1,
[data-theme="accent"] h2,
[data-theme="accent"] h3,
[data-theme="accent"] h4 {
  color: var(--color-warm-white);
}

/* Selection color */
::selection {
  background-color: var(--color-terracotta);
  color: var(--color-warm-white);
}

/* Scrollbar styling (subtle) */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-sand);
}

::-webkit-scrollbar-thumb {
  background: var(--color-deep-blue);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-sand);
}

/* Skip to content (a11y) */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-deep-blue);
  color: var(--color-warm-white);
  font-size: var(--fs-small);
  border-radius: var(--radius-sm);
  z-index: var(--z-toast);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-sm);
}
