/* ==========================================================================
   Colorearte Kids — main.css
   Design tokens + base styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens (CSS variables)
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --color-primary: #E8711D;
  --color-primary-dark: #C85E0F;
  --color-bg: #FFFFFF;
  --color-bg-warm: #FFF8F3;
  --color-bg-footer: #F07B2D;
  --color-text-main: #111111;
  --color-text-body: #444444;
  --color-white: #FFFFFF;

  /* Placeholder fill for images */
  --color-placeholder: #FFF0E8;

  /* Typography */
  --font-display: 'Fredoka One', cursive;
  --font-body: 'Nunito', sans-serif;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  /* Shadows */
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 32px rgba(232, 113, 29, 0.2);

  /* Spacing scale */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 32px;
  --space-lg: 64px;
  --space-xl: 128px;

  /* Layout */
  --container-max: 1200px;
  --header-height: 72px;
}

/* --------------------------------------------------------------------------
   2. Reset / Normalize
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-body);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea {
  font-family: inherit;
  font-size: inherit;
}

/* --------------------------------------------------------------------------
   3. Typography base
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--color-text-main);
  line-height: 1.2;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.6rem;
}

h3 {
  font-size: 1.25rem;
}

p {
  margin-bottom: var(--space-sm);
}

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

/* --------------------------------------------------------------------------
   4. Layout helpers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.section {
  padding: var(--space-lg) 0;
}

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

.section__title {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: var(--space-md);
}

.section__subtitle {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-md);
  color: var(--color-text-body);
}

/* Visually hidden (accessibility) */
.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;
}

/* --------------------------------------------------------------------------
   5. Buttons (base)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 12px 24px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-md);
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
}

.btn--primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn--primary:hover {
  background-color: var(--color-primary-dark);
  transform: scale(1.03);
  box-shadow: var(--shadow-hover);
}

.btn--outline {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn--outline:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
  transform: scale(1.03);
}

.btn--white {
  background-color: var(--color-white);
  color: var(--color-primary);
}

.btn--white:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.btn--lg {
  padding: 16px 32px;
  font-size: 1.1rem;
}

/* Amazon logo inside buttons */
.btn .amazon-logo {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   6. Image placeholder
   -------------------------------------------------------------------------- */
.placeholder {
  background-color: var(--color-placeholder);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 0.9rem;
  text-align: center;
  overflow: hidden;
}

/* Common aspect ratios for placeholders */
.placeholder--book {
  aspect-ratio: 3 / 4;
}

.placeholder--wide {
  aspect-ratio: 16 / 9;
}

.placeholder--square {
  aspect-ratio: 1 / 1;
}

/* Real images placed inside a placeholder container */
.placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.about-preview__avatar img,
.gallery-grid .placeholder img {
  object-fit: cover;
}
