/**
 * Photo Gallery Stylesheet - Base Styles
 * 
 * This stylesheet provides core styling for the photo gallery website.
 * It uses CSS custom properties (variables) for easy theme customization.
 * 
 * Design principles:
 * - Mobile-first: Base styles apply to mobile, larger screens enhance with media queries
 * - Responsive: Flexible layouts that adapt to all screen sizes
 * - Accessible: Proper contrast ratios, focus states, and semantic HTML
 * - Themeable: CSS variables centralize color and sizing decisions
 */


/* ============================================================================
   ROOT & THEME VARIABLES
   ============================================================================ */

:root {
    /* Color Scheme - Adjust these variables to change the entire theme */
    --primary-color: #402c50;
    /* Primary brand color */
    --accent-color: #b434db;
    /* Accent/highlight color */
    --background-color: #ecf0f1;
    /* Main background */
    --surface-color: #ffffff;
    /* Card/surface background */
    --text-primary: #2c3e50;
    /* Primary text color */
    --text-secondary: #7f8c8d;
    /* Secondary/muted text */
    --border-color: #bdc3c7;
    /* Border color */

    /* Component Colors */
    --button-bg: #c834db;
    /* Button background */
    --button-hover: #a829b9;
    /* Button hover state */
    --button-text: #ffffff;
    /* Button text */
    --carousel-bg: #ffffff;
    /* Carousel background */
    --carousel-header-bg: #f8f9fa;
    /* Carousel header background */
    --image-bg: #e0e0e0;
    /* Image placeholder background */
    --tile-bg: #ffffff;
    /* Album tile background */
    --popover-bg: #ffffff;
    /* Popover/dialog background */
    --popover-border: #e0e0e0;
    /* Popover border */
    --link-color: #3498db;
    /* Link color */
    --link-visited: #8e44ad;
    /* Visited link color */

    /* Typography */
    --font-family-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        'Helvetica Neue', Arial, sans-serif;
    --font-family-mono: 'Courier New', monospace;
    --font-size-base: 16px;
    --font-weight-normal: 400;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --line-height-base: 1.5;

    /* Spacing Scale */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --border-radius: 8px;
    --border-radius-lg: 12px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;

    /* Z-index Scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-modal: 1000;
}


/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-sans);
    font-size: 1rem;
    line-height: var(--line-height-base);
    color: var(--text-primary);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure images are responsive by default */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover,
a:focus-visible {
    color: var(--button-hover);
    text-decoration: underline;
}

a:visited {
    color: var(--link-visited);
}

/* Focus styles for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.1rem;
}

h6 {
    font-size: 1rem;
}

/* Paragraphs and text blocks */
p {
    margin-bottom: 1em;
}


/* ============================================================================
   LAYOUT UTILITIES
   ============================================================================ */

main {
    min-height: 100vh;
    padding: var(--spacing-xl) var(--spacing-md);
}

/* Album container - for individual album pages */
.album-container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
}

.album-title {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    color: var(--text-primary);
    word-wrap: break-word;
}

.carousel-section {
    margin-bottom: var(--spacing-2xl);
}


/* ============================================================================
   BUTTONS
   ============================================================================ */

button {
    font-family: var(--font-family-sans);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* ============================================================================
   RESPONSIVE DESIGN - TABLET
   ============================================================================ */

@media (max-width: 768px) {
    /* Typography adjustments */
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    /* Layout adjustments */
    main {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .album-container {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .album-title {
        margin-bottom: var(--spacing-lg);
    }
}


/* ============================================================================
   RESPONSIVE DESIGN - MOBILE
   ============================================================================ */

@media (max-width: 480px) {
    /* Typography scales */
    html {
        font-size: 14px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    h4 {
        font-size: 1.1rem;
    }

    /* Layout adjustments */
    main {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .album-container {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .album-title {
        margin-bottom: var(--spacing-md);
    }

    /* Forms */
    input,
    textarea,
    select {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }
}


/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    body {
        font-weight: 600;
    }

    button {
        border: 2px solid var(--button-bg);
    }
}
