/* Critical CSS - Above-the-fold styles for Oteage Theme */
/* Loaded inline for optimal Core Web Vitals performance */

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    background-color: #fff;
    font-feature-settings: "palt";
    overflow-x: hidden;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    z-index: 999999;
    padding: 8px 16px;
    background: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Screen reader only content */
.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;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 24px;
    }
}

/* Header - Critical above-the-fold */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 70px;
}

.header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    padding: 8px 16px;
}

.header__brand {
    flex-shrink: 0;
}

.header__logo img {
    max-height: 50px;
    width: auto;
}

.header__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.header__title a {
    text-decoration: none;
    color: #2c5aa0;
}

/* Navigation */
.header__nav {
    flex-grow: 1;
    margin: 0 20px;
}

.header__menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.header__menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 24px;
}

.header__menu li {
    margin: 0;
}

.header__menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    display: block;
}

.header__menu a:hover,
.header__menu a:focus {
    background-color: #f5f5f5;
    color: #2c5aa0;
}

/* CTA Section */
.header__cta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header__contact {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header__phone,
.header__line {
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    background: #f8f9fa;
    transition: all 0.2s;
    white-space: nowrap;
}

.header__phone:hover {
    background: #28a745;
    color: #fff;
}

.header__line:hover {
    background: #00b900;
    color: #fff;
}

/* Button styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
    min-height: 44px;
    position: relative;
    overflow: hidden;
}

.btn--primary {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3d72 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.3);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 90, 160, 0.4);
}

.btn--success {
    background: linear-gradient(135deg, #28a745 0%, #20923a 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn--success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn--line {
    background: linear-gradient(135deg, #00b900 0%, #009900 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 185, 0, 0.3);
}

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

.btn--lg {
    padding: 14px 28px;
    font-size: 1.05rem;
}

/* Hero section - Critical above-the-fold */
.hero {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 40px 0 60px;
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

.hero__container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: center;
    min-height: 400px;
}

.hero__content {
    text-align: center;
}

.hero__title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c5aa0;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero__subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 32px;
    line-height: 1.5;
}

.hero__cta {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    margin-bottom: 40px;
}

.hero__btn {
    min-width: 280px;
}

.hero__features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 500px;
    margin: 0 auto;
}

.hero__feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #555;
}

.hero__feature-icon {
    font-size: 1.2rem;
}

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.hero__image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Responsive design - Tablet */
@media (min-width: 768px) {
    .header__container {
        padding: 12px 24px;
    }
    
    .header__menu-toggle {
        display: none;
    }
    
    .hero__container {
        grid-template-columns: 1fr 1fr;
        gap: 60px;
        text-align: left;
    }
    
    .hero__content {
        text-align: left;
    }
    
    .hero__title {
        font-size: 3rem;
    }
    
    .hero__subtitle {
        font-size: 1.3rem;
    }
    
    .hero__cta {
        flex-direction: row;
        gap: 20px;
        justify-content: flex-start;
    }
    
    .hero__features {
        grid-template-columns: repeat(4, 1fr);
        max-width: none;
    }
}

/* Responsive design - Desktop */
@media (min-width: 1024px) {
    .hero {
        padding: 60px 0 80px;
    }
    
    .hero__title {
        font-size: 3.5rem;
    }
    
    .hero__subtitle {
        font-size: 1.4rem;
    }
}

/* Mobile responsive - Critical */
@media (max-width: 767px) {
    .header__menu-toggle {
        display: flex;
    }
    
    .header__menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        gap: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border-radius: 0 0 12px 12px;
        padding: 20px;
    }
    
    .header__menu.is-open {
        display: flex;
    }
    
    .header__menu a {
        padding: 12px 0;
        border-bottom: 1px solid #eee;
    }
    
    .header__cta {
        display: none;
    }
    
    .hero__title {
        font-size: 2rem;
    }
    
    .hero__subtitle {
        font-size: 1.1rem;
    }
    
    .hero__btn {
        min-width: 250px;
    }
}

/* Focus styles for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #2c5aa0;
    outline-offset: 2px;
}

/* Reduce motion for accessibility */
@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;
    }
}

/* Loading states */
.btn--loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn--loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: button-loading-spinner 1s ease infinite;
}

@keyframes button-loading-spinner {
    from {
        transform: rotate(0turn);
    }
    to {
        transform: rotate(1turn);
    }
}