/**
 * Base Styles - 基本スタイル
 * 
 * @package YuuYuuRental
 * @since 1.0.0
 */

/* ==========================================================================
   CSS Variables - カスタムプロパティ
   ========================================================================== */
:root {
    /* Colors */
    --color-primary: #CC211B;
    --color-primary-dark: #A01915;
    --color-secondary: #000000;
    --color-accent: #f8f9fa;
    --color-background: #ffffff;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-text-muted: #999999;
    --color-border: #e0e0e0;
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-error: #dc3545;
    --color-info: #17a2b8;
    
    /* Typography */
    --font-family-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif;
    --font-family-japanese: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif;
    --font-family-heading: var(--font-family-primary);
    
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 1.875rem;  /* 30px */
    --font-size-4xl: 2.25rem;   /* 36px */
    --font-size-5xl: 3rem;      /* 48px */
    
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    
    /* Spacing */
    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.5rem;    /* 8px */
    --spacing-md: 1rem;      /* 16px */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-2xl: 3rem;     /* 48px */
    --spacing-3xl: 4rem;     /* 64px */
    --spacing-4xl: 6rem;     /* 96px */
    
    /* Layout */
    --container-max-width: 1200px;
    --container-padding: 1rem;
    --border-radius-sm: 0.25rem;
    --border-radius-base: 0.375rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    --border-radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
    
    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ==========================================================================
   Reset & Base Styles - リセット・基本スタイル
   ========================================================================== */

/* Modern CSS Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
    margin: 0;
}

ul[role="list"],
ol[role="list"] {
    list-style: none;
}

body {
    min-height: 100vh;
    line-height: var(--line-height-normal);
    display: flex;
    flex-direction: column;
}

#page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#content {
    flex: 1;
}

/* Safari specific fixes */
@supports (-webkit-appearance: none) {
    body {
        min-height: 100vh;
        height: 100%;
    }
    
    #page {
        min-height: 100vh;
    }
}

h1, h2, h3, h4, h5, h6,
button, input, label {
    line-height: var(--line-height-tight);
}

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

textarea {
    resize: vertical;
}

table {
    border-collapse: collapse;
}

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

/* ==========================================================================
   Typography - タイポグラフィ
   ========================================================================== */

body {
    font-family: var(--font-family-primary), var(--font-family-japanese);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    color: var(--color-secondary);
    margin-bottom: var(--spacing-md);
    line-height: var(--line-height-tight);
}

.h1, h1 { font-size: var(--font-size-5xl); }
.h2, h2 { font-size: var(--font-size-4xl); }
.h3, h3 { font-size: var(--font-size-3xl); }
.h4, h4 { font-size: var(--font-size-2xl); }
.h5, h5 { font-size: var(--font-size-xl); }
.h6, h6 { font-size: var(--font-size-lg); }

/* Text elements */
p {
    margin-bottom: var(--spacing-md);
    line-height: var(--line-height-relaxed);
}

a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 0.125em;
    transition: color var(--transition-fast);
}

a:hover,
a:focus {
    color: var(--color-secondary);
    text-decoration: none;
}

a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

strong, b {
    font-weight: var(--font-weight-bold);
}

em, i {
    font-style: italic;
}

small {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
}

/* Lists */
ul, ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-lg);
}

li {
    margin-bottom: var(--spacing-xs);
}

/* ==========================================================================
   Layout Utilities - レイアウトユーティリティ
   ========================================================================== */

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

.section {
    padding: var(--spacing-4xl) 0;
}

.section--sm {
    padding: var(--spacing-2xl) 0;
}

.section--lg {
    padding: var(--spacing-4xl) 0 var(--spacing-4xl) 0;
}

/* Screen reader only */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -9999px;
    left: -9999px;
    background: var(--color-secondary);
    color: var(--color-background);
    padding: var(--spacing-sm) var(--spacing-md);
    text-decoration: none;
    border-radius: var(--border-radius-base);
    z-index: var(--z-tooltip);
    transition: all var(--transition-base);
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
}

.skip-to-content:focus {
    top: 6px;
    left: 6px;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
}