/*
Theme Name: Thème Domus Patris
Theme URI: https://domuspatris.com
Author: Pascal Marechal
Author URI: https://domuspatris.com
Description: Thème du site Domus Patris.
Version: 1.0
Text Domain: domuspatris
Domain Path: /languages
*/

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Georgia', serif;
    background-color: #fce7e9;
    color: #1e3a8a;
    line-height: 1.75;
    margin: 40px;
}

header {
    padding: 15px 0 10px;
    position: relative;
    z-index: 100;
}

.main-content,
.single-story-article {
    max-width: 865px;
    margin: 0 auto;
}

/* Titre du site */
h1 {
    margin: 0;
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
}

h2 {
    margin: 20px 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
}

h3 {
    margin: 20px 0;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 1px;
}

h1 a {
    color: #1e3a8a;
    text-decoration: none;
    transition: color 0.3s;
}

h1 a:hover {
    color: #2c5282;
}

/* Navigation principale */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

nav ul li a {
    color: #1e3a8a;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2rem;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #e05a7e;
}

nav ul li {
    display: flex;
    align-items: center;
}

/* ===================== LANGUAGE DROPDOWN ===================== */
.language-switcher {
    position: relative;
    font-family: 'Georgia', serif;
}

.language-switcher select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: rgba(255, 255, 255, 0.92);
    color: #1e3a8a;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 10px 36px 10px 18px;
    border: none;
    border-radius: 30px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
    text-align: center;
}

.language-switcher select:hover {
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

/* Style du dropdown ouvert (options) */
.language-switcher select option {
    background-color: #fff;
    color: #2c3e50;
    padding: 10px;
    font-size: 1.02rem;
}

/* ===================== STRUCTURE HEADER ===================== */
.container {
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    flex-direction: column;
}

.menu-wrapper {
    display: flex;
    width: 100%;
}

/* Navigation et langue côte à côte */
nav {
    flex: 1;
    display: flex;
}

/* ===================== HISTOIRE ===================== */
.wp-block-file {
    margin-bottom: 2rem;
}

.wp-block-file a {
    display: none;
}

.wp-block-file a.wp-block-file__button {
    display: inline;
}

/* ===================== PDF PREVIEW (PDF.js) ===================== */
.pdfjs-preview {
    margin-bottom: 1.5rem;
    border: 1px solid #f4c6d0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    min-height: 120px;
    transition: opacity .2s ease;
}

.pdfjs-preview-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    height: 52vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.pdfjs-preview-wrapper::-webkit-scrollbar {
    width: 12px;
}

.pdfjs-preview-wrapper::-webkit-scrollbar-track {
    background: #f7f7f7;
}

.pdfjs-preview-wrapper::-webkit-scrollbar-thumb {
    background: #f4c6d0;
    border-radius: 6px;
    border: 2px solid #fff;
}

.pdfjs-preview-wrapper .pdfjs-page {
    display: block;
    max-width: 100% !important;
    height: auto !important;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.12);
}

.pdfjs-preview-wrapper.pdfjs-error .pdfjs-error-msg {
    text-align: center;
    margin: 1.5rem 0.5rem;
    color: #1e3a8a;
}

/* ===================== ARCHIVE DES HISTOIRES ===================== */
.story-list {
    display: flex;
    flex-direction: column;
    gap: 2.8rem;
    margin-top: 2rem;
}

.story-item {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid #f4c6d0;
}

.story-thumbnail {
    flex: 0 0 240px;
}

.story-thumbnail img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.story-thumbnail img:hover {
    transform: scale(1.03);
}

.story-content {
    flex: 1;
    padding-top: 8px;
}

.story-content .story-title {
    margin: 0 0 0.8rem 0;
    font-size: 1.45rem;
    line-height: 1.3;
}

.story-content .story-title a {
    color: #1e3a8a;
    text-decoration: none;
    transition: color 0.3s;
}

.story-content .story-title a:hover {
    color: #e05a7e;
}

.story-content p {
    margin-bottom: 1.2rem;
    color: #334155;
}

.story-meta {
    flex: 0 0 170px;
    text-align: right;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 220px;
}

.story-date {
    margin: 0 0 1.2rem 0;
    color: #e05a7e;
    font-style: italic;
    font-size: 1.05rem;
    text-align: center;
}

.single-story-article .story-age-title {
    margin: 0 0 1.2rem 0;
    font-size: .8rem;
    text-align: center;
}

.read-more {
    display: inline-block;
    padding: 10px 22px;
    background: #e05a7e;
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(224, 90, 126, 0.25);
    white-space: nowrap;
}

.read-more:hover {
    background: #c14a6a;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(224, 90, 126, 0.35);
}

/* Sorting links */
.button {
    margin: 0.75rem 0 1.5rem;
    font-size: 0.98rem;
}

.button a {
    color: #1e3a8a;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 18px;
    font-size: .9rem;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
    margin: 0 6px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.06);
    border: 1px solid transparent;
}

.button a:hover {
    background: rgba(224, 90, 126, 0.08);
    color: #e05a7e;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(224, 90, 126, 0.08);
}

.button a[aria-current] {
    background: #e05a7e;
    color: #fff;
    box-shadow: 0 6px 18px rgba(224, 90, 126, 0.18);
    border-color: rgba(0, 0, 0, 0.02);
    transform: none;
}

.button .age-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: rgba(255, 255, 255, 0.6);
    color: #1e3a8a;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 32px 8px 14px;
    border: 1px solid transparent;
    border-radius: 18px;
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.06);
    cursor: pointer;
    transition: all 0.18s ease;
    margin: 0 6px;
}

.button .age-select:hover {
    background: rgba(224, 90, 126, 0.08);
    color: #e05a7e;
    box-shadow: 0 6px 14px rgba(224, 90, 126, 0.08);
    transform: translateY(-2px);
}

.button .age-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(224, 90, 126, 0.2);
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        text-align: center;
        gap: 25px;
    }

    nav {
        order: 1;
    }

    nav ul {
        justify-content: center;
    }

    .language-switcher {
        order: 2;
    }

    h1 {
        font-size: 2.2rem;
        letter-spacing: 1px;
    }

    h2 {
        font-size: 1rem;
    }

    .menu-wrapper {
        flex-direction: column;
    }

    .menu-wrapper nav {
        margin-bottom: 20px;
        justify-content: center;
    }

    nav ul li a {
        font-size: 1.1rem;
    }

    /* Archive mobile */
    .story-item {
        flex-direction: column;
        align-items: center;
        gap: 1.2rem;
        text-align: center;
    }

    .story-thumbnail {
        flex: 0 0 auto;
        max-width: 100%;
    }

    .story-meta {
        text-align: left;
        flex: none;
        padding-top: 0;
        height: auto;
    }

    .read-more {
        display: block;
        text-align: center;
        width: fit-content;
    }

    .button {
        display: flex;
        justify-content: center;
    }

    .button a {
        padding: 6px 8px;
        margin: 0 4px;
        border-radius: 14px;
        font-size: .6rem;
    }

    .button .age-select  {
        padding: 6px 8px;
        margin: 0 4px;
        border-radius: 14px;
        font-size: .6rem;
        max-width: 100px;
    }

}
