/**
 * DANSK HISTORIE - Styles CSS complets
 * Fichier fusionné contenant tous les styles
 */

/* ============================================================================
   BASE ET VARIABLES
   ============================================================================ */

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

:root {
    --primary: #5a7a6e;
    --accent: #d4a574;
    --text-dark: #2b2b2b;
    --text-medium: #5a5a5a;
    --text-light: #8a8a8a;
    --bg-main: #ffffff;
    --bg-subtle: #f8f8f8;
    --border: #e8e8e8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.7;
    padding: 0;
    min-height: 100vh;
}

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

/* ============================================================================
   COMMON - Éléments partagés entre toutes les pages
   ============================================================================ */

/* Header avec image pleine largeur en haut */
header {
    padding: 0;
    background: var(--bg-main);
    text-align: center;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.header-image {
    position: relative;
    height: 250px;
    overflow: hidden;
    width: 100%;
}

.header-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transform: scale(1);
    transition: none;
    will-change: transform;
}

header h1 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: -0.01em;
    padding: 1.5rem 1.5rem 1rem;
    margin: 0;
    opacity: 1;
    transition: opacity 0.3s ease-out;
}

/* ============================================================================
   PAGE PRINCIPALE (index.html)
   ============================================================================ */

/* Animation d'apparition */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Story Container */
.story-container {
    padding: 2rem 1.5rem;
    max-width: 100%;
    animation: fadeIn 0.6s ease-out;
}

.story-header {
    margin-bottom: 2rem;
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.story-date {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.story-title-da {
    font-size: 1.625rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.625rem;
    line-height: 1.3;
}

.story-title-fr {
    font-size: 0.9375rem;
    color: var(--text-medium);
    font-weight: 400;
}

.story-text {
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: var(--bg-subtle);
    border-left: 3px solid var(--primary);
}

.story-text p {
    margin-bottom: 1rem;
}

.story-text p:last-child {
    margin-bottom: 0;
}

/* Section traduction */
.translation-section {
    margin-bottom: 2.5rem;
}

.toggle-translation {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-dark);
}

.toggle-translation:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(90, 122, 110, 0.2);
}

.toggle-icon {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.toggle-translation.active .toggle-icon {
    transform: rotate(90deg);
}

.toggle-translation.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.translation-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, margin-top 0.4s ease-out, opacity 0.3s ease-out;
    opacity: 0;
}

.translation-content.visible {
    max-height: 2000px;
    margin-top: 1rem;
    opacity: 1;
}

.translation-content p {
    font-size: 0.9375rem;
    color: var(--text-medium);
    line-height: 1.7;
    margin-bottom: 1rem;
    padding: 1.25rem;
    background: white;
    border-left: 3px solid var(--accent);
    border-radius: 8px;
}

.translation-content p:last-child {
    margin-bottom: 0;
}

/* Questions épurées */
.questions-section {
    margin-bottom: 2.5rem;
}

.questions-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.questions-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.questions-list li {
    padding-left: 1.5rem;
    color: var(--text-dark);
    position: relative;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.questions-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 600;
}

/* Glossaire épuré */
.glossaire-section {
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
}

.glossaire-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.glossaire-list {
    display: grid;
    gap: 0.75rem;
}

.glossaire-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    padding: 0.75rem 0;
}

.glossaire-mot {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9375rem;
}

.glossaire-separator {
    display: none;
}

.glossaire-traduction {
    color: var(--text-medium);
    font-size: 0.9375rem;
}

/* ============================================================================
   PAGE ARCHIVES (archives.html)
   ============================================================================ */

.archives-container {
    padding: 2rem 1.5rem;
    max-width: 100%;
}

/* Navigation des archives */
.archives-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn-random {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.15);
}

.btn-random:hover {
    background: #c69463;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 165, 116, 0.25);
}

.btn-back {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(90, 122, 110, 0.15);
}

.btn-back:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 165, 116, 0.25);
}

/* Calendrier */
.calendar-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.calendar-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.btn-nav {
    background: var(--bg-subtle);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-nav:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(90, 122, 110, 0.2);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.calendar-weekdays > div {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-medium);
    text-transform: uppercase;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-subtle);
    color: var(--text-dark);
    border: none;
    position: relative;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.calendar-day:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(90, 122, 110, 0.2);
}

.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
    box-shadow: none;
}

.calendar-day.empty:hover {
    transform: none;
}

.calendar-day.today {
    background: var(--accent);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(212, 165, 116, 0.3);
}

.calendar-day.has-story::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
}

.calendar-day.today::after {
    background: white;
}

.calendar-day.future {
    background: var(--bg-subtle);
    color: var(--text-light);
    cursor: not-allowed;
    opacity: 0.5;
}

.calendar-day.future:hover {
    background: var(--bg-subtle);
    color: var(--text-light);
    transform: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* ============================================================================
   FOOTER
   ============================================================================ */

footer {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.8125rem;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
}

footer p {
    margin-bottom: 1rem;
}

.archives-button {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(90, 122, 110, 0.15);
}

.archives-button:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 165, 116, 0.25);
}

/* ============================================================================
   RESPONSIVE - TABLET (640px+)
   ============================================================================ */

@media (min-width: 640px) {
    body {
        padding: 2rem;
        background: var(--bg-subtle);
    }

    .container {
        max-width: 640px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    .header-image {
        height: 320px;
    }

    header h1 {
        font-size: 1.375rem;
        padding: 2rem 2rem 1.5rem;
    }

    header.sticky h1 {
        font-size: 1.125rem;
        padding: 1.25rem 2rem;
    }

    .story-container {
        padding: 2.5rem 2.5rem;
    }

    .story-title-da {
        font-size: 2rem;
    }

    .story-text {
        font-size: 1.0625rem;
        padding: 2rem;
    }

    .glossaire-item {
        grid-template-columns: minmax(140px, auto) auto 1fr;
        gap: 1rem;
    }

    .glossaire-separator {
        display: block;
        color: var(--text-light);
    }

    /* Archives - Tablet */
    .archives-nav {
        flex-direction: row;
        justify-content: space-between;
    }

    .btn-action {
        flex: 1;
        max-width: 300px;
    }

    .calendar-section {
        padding: 2rem;
    }

    .calendar-days {
        gap: 0.75rem;
    }

    .calendar-day {
        font-size: 1rem;
    }
}

/* ============================================================================
   RESPONSIVE - DESKTOP (1024px+)
   ============================================================================ */

@media (min-width: 1024px) {
    .container {
        max-width: 720px;
    }

    .story-container {
        padding: 3.5rem 3.5rem;
    }

    .story-title-da {
        font-size: 2.25rem;
    }

    .story-text {
        font-size: 1.125rem;
        padding: 2.5rem;
    }

    /* Archives - Desktop */
    .archives-container {
        padding: 3rem 3.5rem;
    }

    .calendar-section {
        padding: 2.5rem;
    }
}
