/* ====================================
   恋みくじガイド - Main Stylesheet
   koimikuji-guide.com
   ==================================== */

/* ====================================
   1. CSS Reset & Base Styles
   ==================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Layout Shift Prevention */
img, video, iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

body {
    font-display: swap;
}

.card-image {
    min-height: 200px;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    contain: layout style paint;
}

.hero {
    min-height: 400px;
}

.header {
    min-height: 60px;
}
/* End Layout Shift Prevention */

:root {
    --primary-color: #FF6B9D;
    --secondary-color: #FFD700;
    --dark-color: #333333;
    --light-color: #FFFFFF;
    --gray-color: #F5F5F5;
    --border-color: #E0E0E0;
    --text-color: #333333;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    line-height: 1.8;
    color: var(--text-color);
    background-color: var(--light-color);
    overflow-x: hidden;
}

/* ====================================
   2. Typography
   ==================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
}

h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    color: var(--primary-color);
}

h4 {
    font-size: 1.25rem;
    margin-top: 1rem;
}

p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #ff4d7d;
    text-decoration: underline;
}

strong {
    font-weight: 700;
    color: var(--primary-color);
}

/* ====================================
   3. Header & Navigation
   ==================================== */
.header {
    background: linear-gradient(135deg, var(--primary-color), #ff8db3);
    color: var(--light-color);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1000;
}

.header-top {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--light-color);
}

.logo-text p {
    font-size: 0.875rem;
    margin: 0;
    opacity: 0.9;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--light-color);
    font-size: 1.5rem;
    cursor: pointer;
}

.main-nav {
    background-color: rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-nav li {
    margin: 0;
}

.main-nav a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--light-color);
    font-weight: 500;
    transition: var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

/* ====================================
   4. Hero Section
   ==================================== */
.hero {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.9), rgba(255, 141, 179, 0.9)),
                url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><rect fill="%23FFE5EE" width="1200" height="600"/></svg>');
    background-size: cover;
    background-position: center;
    color: var(--light-color);
    text-align: center;
    padding: 4rem 1rem;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 3rem;
    color: var(--light-color);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    background-color: var(--light-color);
    color: var(--primary-color);
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow);
    border: 2px solid transparent;
}

.btn:hover {
    background-color: var(--primary-color);
    color: var(--light-color);
    border-color: var(--light-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-decoration: none;
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--light-color);
    color: var(--light-color);
}

.btn-secondary:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

/* ====================================
   5. Container & Layout
   ==================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin-bottom: 3rem;
}

.main-content {
    background-color: var(--light-color);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* ====================================
   6. Sidebar
   ==================================== */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-widget {
    background-color: var(--light-color);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.sidebar-widget h3 {
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.sidebar-widget ul {
    list-style: none;
    padding: 0;
}

.sidebar-widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-widget li:last-child {
    border-bottom: none;
}

.sidebar-widget a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
}

.sidebar-widget a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

/* AdSense Placeholder */
.ad-widget {
    background-color: var(--gray-color);
    padding: 1rem;
    text-align: center;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--border-color);
    color: #999;
    font-size: 0.875rem;
}

/* ====================================
   7. Content Sections
   ==================================== */
.section {
    margin-bottom: 3rem;
    padding: 2rem;
    background-color: var(--light-color);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.intro-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #555;
    padding: 1.5rem;
    background-color: #fff5f8;
    border-left: 4px solid var(--primary-color);
    border-radius: 5px;
    margin-bottom: 2rem;
}

/* ====================================
   8. Table of Contents
   ==================================== */
.toc {
    background-color: #fff5f8;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.toc h2 {
    font-size: 1.25rem;
    margin-top: 0;
    border-bottom: 2px solid var(--primary-color);
}

.toc ul {
    list-style: none;
    padding-left: 0;
}

.toc ul ul {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.toc li {
    margin-bottom: 0.5rem;
}

.toc a {
    color: var(--text-color);
    display: block;
    padding: 0.25rem 0;
}

.toc a:hover {
    color: var(--primary-color);
    padding-left: 0.5rem;
}

/* ====================================
   9. Cards & Grid
   ==================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.card {
    background-color: var(--light-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #FFE5EE, #FFB3D9);
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.card-description {
    color: #666;
    margin-bottom: 1rem;
}

.card-link {
    color: var(--primary-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ====================================
   10. Info Boxes & Callouts
   ==================================== */
.info-box {
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    border-left: 4px solid;
}

.info-box.success {
    background-color: #e8f5e9;
    border-color: #4caf50;
}

.info-box.warning {
    background-color: #fff3e0;
    border-color: #ff9800;
}

.info-box.danger {
    background-color: #ffebee;
    border-color: #f44336;
}

.info-box.info {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

.info-box h4 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ====================================
   11. Tables
   ==================================== */
.table-wrapper {
    overflow-x: auto;
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--light-color);
    box-shadow: var(--shadow);
}

thead {
    background-color: var(--primary-color);
    color: var(--light-color);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
}

tbody tr:hover {
    background-color: #fff5f8;
}

/* ====================================
   12. Lists
   ==================================== */
.content-list {
    margin-bottom: 2rem;
}

.content-list ul,
.content-list ol {
    padding-left: 2rem;
}

.content-list li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.checklist {
    list-style: none;
    padding-left: 0;
}

.checklist li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
}

.checklist li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.25rem;
}

/* ====================================
   13. FAQ Section
   ==================================== */
.faq-item {
    background-color: var(--light-color);
    margin-bottom: 1rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.faq-question {
    padding: 1.5rem;
    background-color: #fff5f8;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--dark-color);
    transition: var(--transition);
}

.faq-question:hover {
    background-color: #ffe5ee;
}

.faq-answer {
    padding: 1.5rem;
    display: none;
    line-height: 1.8;
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-toggle {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

/* ====================================
   14. Breadcrumbs
   ==================================== */
.breadcrumbs {
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.breadcrumbs ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
    color: #666;
}

.breadcrumbs li:after {
    content: '›';
    margin-left: 0.5rem;
    color: #999;
}

.breadcrumbs li:last-child:after {
    content: '';
}

.breadcrumbs a {
    color: #666;
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

/* ====================================
   15. Footer
   ==================================== */
.footer {
    background-color: #2c2c2c;
    color: #ccc;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--light-color);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ccc;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #444;
    color: #999;
    font-size: 0.875rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-color: #444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--light-color);
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

/* ====================================
   16. Responsive Design
   ==================================== */
@media (max-width: 968px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .main-nav ul {
        flex-direction: column;
    }
    
    .main-nav a {
        padding: 0.75rem 1rem;
    }
    
    .main-nav.active {
        display: block;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
}

/* Sticky header only on desktop */
@media (min-width: 769px) {
    .header {
        position: sticky;
        top: 0;
    }
}

/* ====================================
   17. Utilities
   ==================================== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.highlight {
    background-color: #fff9c4;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}

.emoji {
    font-style: normal;
}

/* ====================================
   18. Loading & Animations
   ==================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ====================================
   19. Print Styles
   ==================================== */
@media print {
    .header,
    .sidebar,
    .footer,
    .breadcrumbs,
    .hero-buttons,
    .ad-widget {
        display: none;
    }
    
    body {
        font-size: 12pt;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
}

/* Footer */
.site-footer{background:#111;color:#fff;margin-top:3rem;padding:2rem 0}
.footer-links{display:flex;flex-wrap:wrap;gap:1rem;list-style:none;margin:0;padding:0}
.footer-links a{color:#fff;text-decoration:none;border-bottom:1px dotted rgba(255,255,255,.3)}
.footer-links a:hover{border-bottom-color:#fff}
.site-footer .container{max-width:1200px;margin:0 auto;padding:0 1rem}
.site-footer p{margin-top:1rem;color:#ccc}
