/*
 * ==============================================================================
 * Main Stylesheet - Showaru Theme
 * ==============================================================================
 * Based on LittleLink by Seth Cottle
 * https://littlelink.io
 * 
 * Free to use under the MIT license
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * This file contains all core styles for the Showaru theme including:
 * - Typography system
 * - Layout and grid
 * - Buttons and interactive elements
 * - Avatar styling
 * - Theme system (light/dark/auto)
 * - Responsive design breakpoints
 * ==============================================================================
 */

/* ==============================================================================
 * CSS Custom Properties / Variables
 * ==============================================================================
 * Design tokens for typography scale and spacing
 * Provides consistent sizing throughout the site
 * ------------------------------------------------------------------------------ */

:root {
  /* Base font size - Browser default */
  font-size: 16px;

  /* Typography Scale - Using 1.25 modular scale */
  --scale-0: 1rem;      /* 16px - Small text */
  --scale-1: 1.25rem;   /* 20px - Body text */
  --scale-2: 1.563rem;  /* 25px - Subheading */
  --scale-3: 1.953rem;  /* 31px - Heading */
  --scale-4: 2.441rem;  /* 39px - Large heading */
  --scale-5: 3.052rem;  /* 49px - Extra large heading */

  /* Spacing Units */
  --spacing-xs: 0.5rem; /* 8px */
  --spacing-s: 1rem;     /* 16px */
  --spacing-m: 1.5rem;   /* 24px */
  --spacing-l: 2rem;     /* 32px */
  --spacing-xl: 3rem;    /* 48px */
  --spacing-xxl: 4rem;   /* 64px */
}

/* ==============================================================================
 * Layout and Grid System
 * ==============================================================================
 * Container-based layout for centering content
 * ------------------------------------------------------------------------------ */

/**
 * Main container for all page content
 * Centers content horizontally and constrains max width
 */
.container {
  position: relative;
  width: 100%;
  max-width: 37.5rem; /* 600px */
  text-align: center;
  margin: 0 auto;
  padding: 3rem 1.25rem 0 1.25rem; /* 48px top, 20px sides, 0 bottom */
  box-sizing: border-box;
}

/**
 * Left-aligned container variant
 * Used for pages like privacy policy
 */
.container-left {
  position: relative;
  width: 100%;
  max-width: 37.5rem; /* 600px */
  text-align: left;
  margin: 0 auto;
  padding: 0 1.25rem; /* 20px sides */
  box-sizing: border-box;
}

/**
 * Paragraph spacing in left-aligned containers
 */
.container-left p {
  margin-bottom: 1rem; /* 16px space between paragraphs */
}

/**
 * Column wrapper for content
 */
.column {
  position: center;
  width: 100%;
  float: center;
  box-sizing: border-box;
}

/* ==============================================================================
 * Base Styles
 * ==============================================================================
 * Global body styles and typography defaults
 * ------------------------------------------------------------------------------ */

/**
 * Base body styles
 * Sets default font family, colors, and typography
 */
body {
  margin: 0;
  padding: 0;
  background-color: #ffffff;
  color: #1a1a1a;
  font-family: "Outfit", sans-serif;
  font-size: 1.125rem; /* 18px */
  font-weight: 400;
  line-height: 1.6;
}

/* ==============================================================================
 * Typography
 * ==============================================================================
 * Heading and text styles
 * ------------------------------------------------------------------------------ */

/**
 * Main page heading (h1)
 * Large, bold title displayed below avatar
 */
h1 {
  margin: 0 0 0.5rem 0; /* 0 top/bottom margin, 8px bottom */
  font-size: 3rem; /* 48px */
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto; /* Automatic hyphenation at line breaks */
}

/**
 * Paragraph spacing in containers
 */
.container p {
  margin: 0 0 2rem 0; /* 0 top/right, 32px bottom */
}

/**
 * Typography scale implementation for headings
 * Uses CSS custom properties for responsive scaling
 */
h1 {
  margin: 0 0 var(--spacing-m) 0; /* 24px bottom margin */
  font-size: var(--scale-5); /* ~49px */
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/**
 * Body text sizing
 */
body {
  font-size: var(--scale-1); /* 20px */
  line-height: 1.6;
}

/**
 * Container paragraph styling
 */
.container p {
  margin: 0 0 var(--spacing-xl) 0; /* 48px bottom margin */
  font-size: var(--scale-1); /* 20px */
  line-height: 1.6;
}

/**
 * Container spacing update with custom properties
 */
.container {
  padding: var(--spacing-xl) var(--spacing-m) 0 var(--spacing-m); /* 48px top, 24px sides */
  text-align: center;
}

/* ==============================================================================
 * Avatar Image
 * ==============================================================================
 * Profile picture styling with various corner options
 * ------------------------------------------------------------------------------ */

/**
 * Avatar base styles
 * Square image with rounded corners, centered display
 */
.avatar {
  width: 8rem; /* 128px */
  height: 8rem; /* 128px */
  border-radius: 50%;
  object-fit: cover;
  background-position: center;
  margin-bottom: var(--spacing-l); /* 32px bottom margin */
  margin-left: auto;
  margin-right: auto;
  display: block;
}

/**
 * Avatar modifier: No rounding
 * Square image with sharp corners
 */
.avatar--none {
  border-radius: 0%;
}

/**
 * Avatar modifier: Fully rounded
 * Creates perfect circle (default)
 */
.avatar--rounded {
  border-radius: 50%;
}

/**
 * Avatar modifier: Soft rounding
 * Slightly rounded corners (8px radius)
 */
.avatar--soft {
  border-radius: 0.5rem; /* 8px rounded corners */
}

/* ==============================================================================
 * Footer
 * ==============================================================================
 * Copyright and attribution information
 * ------------------------------------------------------------------------------ */

/**
 * Footer section styling
 */
footer {
  margin: var(--spacing-xxl) 0; /* 64px top and bottom */
  font-size: var(--scale-0); /* 16px */
}

/* ==============================================================================
 * Responsive Design
 * ==============================================================================
 * Mobile-first responsive breakpoints
 * ------------------------------------------------------------------------------ */

/**
 * Extra small devices (550px and below)
 * Adjusts typography and spacing for mobile screens
 */
@media (max-width: 34.375rem) { /* 550px */
  h1 {
    font-size: var(--scale-4); /* ~39px */
  }

  body {
    font-size: var(--scale-0); /* 16px */
  }

  .container p {
    font-size: var(--scale-0); /* 16px */
  }

  .avatar {
    margin-bottom: var(--spacing-m); /* 24px */
  }

  footer {
    margin: var(--spacing-xl) 0; /* 48px top and bottom */
  }
}

/**
 * Small devices (400px and up)
 * Adjusts container padding for slightly larger screens
 */
@media (min-width: 25rem) { /* 400px */
  .container {
    width: 85%;
    padding-left: 0;
    padding-right: 0;
  }
}

/**
 * Medium devices (550px and up)
 * Full width optimization for tablets and larger
 */
@media (min-width: 34.375rem) { /* 550px */
  .container {
    width: 80%;
  }

  .column,
  .columns {
    margin-left: 0;
  }

  .column:first-child,
  .columns:first-child {
    margin-left: 0;
  }
}

/* ==============================================================================
 * Links
 * ==============================================================================
 * Default link styles with hover effects
 * ------------------------------------------------------------------------------ */

/**
 * Base link styling
 */
a {
  color: #2457F5;
  text-decoration: underline;
}

/**
 * Link hover state
 */
a:hover {
  color: #083BDA;
}

/* ==============================================================================
 * Buttons
 * ==============================================================================
 * Social media button styles and layout
 * ------------------------------------------------------------------------------ */

/**
 * Button base styles
 * Creates consistent button appearance across all social links
 */
.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18.75rem; /* 300px */
  min-height: 3rem; /* 48px */
  padding: 0.75rem 1rem; /* 12px vertical, 16px horizontal */
  font-size: 1.125rem; /* 18px */
  font-weight: 700;
  text-decoration: none;
  white-space: normal;
  background-color: var(--button-background, transparent);
  color: var(--button-text, #000000);
  border: var(--button-border, none);
  border-radius: 0.5rem; /* 8px */
  cursor: pointer;
  box-sizing: border-box;
  hyphens: auto; /* Automatic hyphenation at line breaks */
  margin-bottom: 1rem; /* 16px space between buttons */
  text-align: center;
  line-height: 1.3;
}

/**
 * Button hover state
 * Maintains button text color during hover
 */
.button:hover,
button:hover {
  color: var(--button-text);
}

/* ==============================================================================
 * Icons
 * ==============================================================================
 * Icon styling within buttons
 * ------------------------------------------------------------------------------ */

/**
 * Icon styling
 * SVG icons displayed alongside button text
 */
.icon {
  width: 1.25rem; /* 20px */
  height: 1.25rem; /* 20px */
  margin-right: 0.5rem; /* 8px spacing from text */
  flex-shrink: 0; /* Prevents icon from shrinking */
}

/* ==============================================================================
 * Theme System
 * ==============================================================================
 * Light and dark mode color schemes
 * ------------------------------------------------------------------------------ */

/**
 * Dark Theme
 * Applies dark color scheme when explicitly set
 */
:root.theme-dark {
  color-scheme: dark;
}

/**
 * Focus outline for dark theme
 * Blue outline for keyboard navigation
 */
:root.theme-dark :focus-visible {
  outline: 2px solid #4899F7;
  outline-offset: 2px;
}

/**
 * Dark theme body styles
 * Dark background with light text
 */
:root.theme-dark body {
  background-color: #121212;
  color: #ffffff;
}

/**
 * Dark theme link colors
 */
:root.theme-dark a:not(.button) {
  color: #4899F7;
}

/**
 * Dark theme link hover colors
 */
:root.theme-dark a:not(.button):hover {
  color: #7AB8FF;
}

/**
 * Auto Theme
 * Automatically switches based on system preferences
 */
:root.theme-auto {
  color-scheme: light dark;
}

/**
 * Auto theme: Dark mode styles
 * Applies when user's system prefers dark mode
 */
@media (prefers-color-scheme: dark) {
  :root.theme-auto body {
    background-color: #121212;
    color: #ffffff;
  }

  :root.theme-auto :focus-visible {
    outline: 2px solid #4899F7;
    outline-offset: 2px;
  }

  :root.theme-auto a:not(.button) {
    color: #4899F7;
  }

  :root.theme-auto a:not(.button):hover {
    color: #7AB8FF;
  }
}

/* ==============================================================================
 * Privacy Page Styles
 * ==============================================================================
 * Additional styles for content pages (privacy, terms, etc.)
 * ------------------------------------------------------------------------------ */

/**
 * Navigation styling for multi-page sites
 */
nav {
  margin: var(--spacing-l) 0; /* 32px top and bottom */
  text-align: left;
}

/**
 * Section spacing for content pages
 */
section {
  margin: var(--spacing-xl) 0; /* 48px top and bottom */
  text-align: left;
}

/**
 * Secondary heading (h2) styling
 * Used for main section titles
 */
h2 {
  font-size: var(--scale-3); /* ~31px */
  font-weight: 700;
  margin-bottom: var(--spacing-m); /* 24px */
}

/**
 * Tertiary heading (h3) styling
 * Used for subsection titles
 */
h3 {
  font-size: var(--scale-2); /* ~25px */
  font-weight: 600;
  margin: var(--spacing-l) 0 var(--spacing-s) 0; /* 32px top, 16px bottom */
}

/**
 * Unordered list styling for content pages
 */
ul {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--spacing-m) 0; /* 24px bottom */
}

/**
 * List item spacing
 */
ul li {
  margin-bottom: var(--spacing-xs); /* 8px between items */
}

/**
 * Responsive adjustments for privacy pages
 */
@media (max-width: 34.375rem) { /* 550px */
  h2 {
    font-size: var(--scale-2); /* ~25px */
  }

  h3 {
    font-size: var(--scale-1); /* ~20px */
  }

  section {
    margin: var(--spacing-l) 0; /* 32px */
  }
}

/**
 * Responsive typography for extra large content
 */
@media (max-width: 34.375rem) { /* 550px */
  h1 {
    font-size: 2rem; /* 32px */
  }

  body {
    font-size: 1rem; /* 16px */
  }
}

/* ==============================================================================
 * Font Face Definitions
 * ==============================================================================
 * Self-hosted font files for Open Sans
 * Provides fallback if Google Fonts fail to load
 * ------------------------------------------------------------------------------ */

/**
 * Open Sans Regular (400 weight)
 */
@font-face {
  font-display: swap;
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-regular.eot');
  src: url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-regular.eot?#iefix') format('embedded-opentype'),
       url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-regular.woff2') format('woff2'),
       url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-regular.woff') format('woff'),
       url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-regular.ttf') format('truetype'),
       url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-regular.svg#OpenSans') format('svg');
}

/**
 * Open Sans Semi-Bold (600 weight)
 */
@font-face {
  font-display: swap;
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-600.eot');
  src: url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-600.eot?#iefix') format('embedded-opentype'),
       url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-600.woff2') format('woff2'),
       url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-600.woff') format('woff'),
       url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-600.ttf') format('truetype'),
       url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-600.svg#OpenSans') format('svg');
}

/**
 * Open Sans Bold (700 weight)
 */
@font-face {
  font-display: swap;
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-700.eot');
  src: url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-700.eot?#iefix') format('embedded-opentype'),
       url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-700.woff2') format('woff2'),
       url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-700.woff') format('woff'),
       url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-700.ttf') format('truetype'),
       url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-700.svg#OpenSans') format('svg');
}

/**
 * Open Sans Extra Bold (800 weight)
 */
@font-face {
  font-display: swap;
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 800;
  src: url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-800.eot');
  src: url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-800.eot?#iefix') format('embedded-opentype'),
       url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-800.woff2') format('woff2'),
       url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-800.woff') format('woff'),
       url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-800.ttf') format('truetype'),
       url('../fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-800.svg#OpenSans') format('svg');
}
