/* -------------------------------------------------------
   Studio Sun & Sea — Global Styles
   Warm minimalism • Calm typography • Soft color palette
-------------------------------------------------------- */

/* ---------------------------------
   1. CSS RESET (modern + minimal)
---------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  scrollbar-gutter: stable; /* Keeps layout tracking solid during thrashed resizing */
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100%;
}

/* Remove default link underlines */
a {
  text-decoration: none;
  color: inherit;
}

p a,
li a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

p a:hover,
li a:hover {
  color: var(--color-accent-strong);
  text-decoration-thickness: 2px;
}

/* ---------------------------------
   2. DESIGN TOKENS
---------------------------------- */

:root {
  /* Colors — Warm Minimalism */
  --color-bg: #F7EFEA;          /* Seashell Warm */
  --color-text: #3A3A3C;        /* Deep Slate */
  --color-text-soft: #6E6E73;   /* Soft Slate */
  --color-border: #E8DCCF;      /* Sandstone Line */
  --color-accent: #CFA79E;      /* Terracotta Soft */
  --color-accent-hover: #C5978D;

  /* Typography */
  --font-heading: "Cormorant Garamond", serif;
  --font-body: "Inter", sans-serif;

  /* Type scale */
  --text-xxs: 0.5rem;  /*  8px */
  --text-xs: 0.75rem;  /* 12px */
  --text-sm: 0.875rem; /* 14px */
  --text-md: 1rem;     /* 16px */
  --text-lg: 1.125rem; /* 18px */
  --text-xl: 1.5rem;   /* 24px */
  --text-xxl: 2.25rem; /* 36px */

  /* Radius scale */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --radius-xl: 16px;

  /* Spacing scale (soft, airy) */
  --space-xxs: 4px;
  --space-xs:  8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 48px;
  --space-xl: 96px;
  --space-xxl: 144px;
  --padding-button: 12px 24px;

  /* Offset scale */
  --offset-sm: -16px;
  --offset-md: -32px;
  --offset-lg: -64px;
  --offset-xl: -128px;

  /* Thumbnail scale */
  --thumbnail-width-sm: 120px;
  --thumbnail-width-md: 180px;
  --thumbnail-width-lg: 260px;

  /* Layout */
  --max-width: clamp(320px, 90vw, 1040px);
  --mobile-max-width: 600px;
  --header-width: 900px;
  --table-layout-mode: fixed; /* ensures consistent column widths */
}

@custom-media --mobile (max-width: 600px);

/* ---------------------------------
   3. TYPOGRAPHY
---------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text);
  margin: var(--space-xs) 0 var(--space-sm) 0;
  font-weight: 600;
}

h1 {
  font-size: var(--text-xxl);
}

h2 {
  font-size: var(--text-xl);
}

h3 {
  font-size: var(--text-lg);
}

p {
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--text-md);
  color: var(--color-text-soft);
}

/* ---------------------------------
   4. LINKS
---------------------------------- */

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

/* ---------------------------------
   5. BUTTONS (minimal)
---------------------------------- */

.button {
  display: inline-block;
  align-self: center;
  padding: var(--padding-button);
  background: var(--color-accent);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  text-decoration: none;
  border-radius: var(--radius-lg);
  white-space: nowrap;
}

.button:hover {
  background: var(--color-accent-hover);
}

/* ---------------------------------
   6. TABLES (consistent columns)
---------------------------------- */

table {
  margin: 0 0 var(--space-sm) 0;
  width: 100%;
  border-collapse: collapse;
  table-layout: var(--table-layout-mode);
}

table th {
  text-align: left; /* fix default browser centering */
}

table th,
table td {
  padding: 0.5rem 0;
}

/* Default 2-column layout */
table th:first-child,
table td:first-child {
  width: 40%;
}

/* opt-out for global layout when needed */
table.no-global {
  table-layout: auto;
}

table.no-global th:first-child,
table.no-global td:first-child,
table.no-global th:last-child,
table.no-global td:last-child {
  width: auto;
}

/* ---------------------------------
   7. RESPONSIVE LAYOUTS (MOBILE)
---------------------------------- */

/* --mobile-max-width */
@media (width <= 600px) {
  :root {
    --table-layout-mode: auto;
    --thumbnail-width-md: 120px; /* var(--thumbnail-width-sm) */
    --thumbnail-width-lg: 180px; /* var(--thumbnail-width-md) */
  }
}

/* ---------------------------------
   8. LAYOUT UTILITIES
---------------------------------- */

.container {
  width: var(--max-width);
  margin: 0 auto;
}

.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  contain: paint;
}

.layout-main {
  flex: 1; /* Push the footer down */
  display: flex;
  flex-direction: column;
}

section {
  border-bottom: 1px solid var(--color-border);
}

/* ---------------------------------
   9. HEADER + FOOTER BASELINE
---------------------------------- */

header, footer {
  font-family: var(--font-body);
  color: var(--color-text-soft);
  flex-shrink: 0;
}

/* ---------------------------------
   10. IMAGES
---------------------------------- */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

#teachers img {
  float: right;
  margin-left: var(--space-sm);
  border-radius: var(--radius-lg);
}

.thumbnail-right {
  float: right;
  margin-left: var(--space-sm);
  border-radius: var(--radius-xl);
}

.thumbnail-sm img {
  width: var(--thumbnail-width-sm);
}

.thumbnail-md img {
  width: var(--thumbnail-width-md);
}

.thumbnail-lg img {
  width: var(--thumbnail-width-lg);
}

/* TODO: aspect does not work as expected. */
.aspect-square {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.aspect-portrait {
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.aspect-headshot {
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.aspect-landscape {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.aspect-square img,
.aspect-portrait img,
.aspect-landscape img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
}
