/*
Theme Name: Sotto v1
Author: Soufyane Zanfoukh
Description: A comic-inspired WordPress portfolio theme for narration graphique, pedagogical engineering, research, articles, and contact pages.
Version: 1.0.5
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sotto-v1
Tags: blog, portfolio, one-column, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root {
    --encre: #1a1a1a;
    --papier: #fdfaf0;
    --jaune-dup: #ffde03;
    --rouge-dup: #e30613;
    --bleu-dup: #22a6b3;
    --gris-trame: #dcdde1;
    --trait: 3px;
    --font-titre: "Permanent Marker", cursive;
    --font-cartouche: "Gochi Hand", cursive;
    --font-texte: "Patrick Hand", cursive;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--gris-trame);
    background-image: radial-gradient(rgba(0, 0, 0, 0.05) 2px, transparent 0);
    background-size: 30px 30px;
    color: var(--encre);
    font-family: var(--font-texte);
    font-size: 1.25rem;
    line-height: 1.5;
}

body,
button,
input,
select,
textarea {
    font-family: var(--font-texte);
}

a {
    color: var(--rouge-dup);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.18em;
}

a:hover,
a:focus {
    color: var(--encre);
}

img {
    max-width: 100%;
    height: auto;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.screen-reader-text:focus {
    top: 8px;
    left: 8px;
    z-index: 100000;
    width: auto;
    height: auto;
    padding: 10px 14px;
    clip: auto;
    background: var(--papier);
    border: var(--trait) solid var(--encre);
    color: var(--encre);
    font-weight: 700;
}

.site-container,
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.site-header {
    background: var(--papier);
    border-bottom: var(--trait) solid var(--encre);
}

.site-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 14px;
}

.custom-logo-link img {
    display: block;
    width: 54px;
    height: 54px;
    object-fit: cover;
    border: 2px solid var(--encre);
    border-radius: 50%;
    background: var(--jaune-dup);
}

.site-branding .custom-logo {
    filter: none;
}

.site-title {
    margin: 0;
    font-family: var(--font-titre);
    font-size: 1.55rem;
    line-height: 1.1;
    text-transform: uppercase;
}

.site-title a {
    color: var(--rouge-dup);
    text-decoration: none;
}

.site-description {
    margin: 2px 0 0;
    font-family: var(--font-cartouche);
    font-size: 1rem;
    font-weight: 700;
}

.menu-toggle {
    display: none;
    padding: 10px 14px;
    background: var(--jaune-dup);
    border: 2px solid var(--encre);
    box-shadow: 4px 4px 0 var(--encre);
    color: var(--encre);
    cursor: pointer;
    font-family: var(--font-cartouche);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.primary-menu,
.primary-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.primary-menu {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.primary-menu a {
    display: inline-block;
    padding: 7px 11px;
    border: 2px solid transparent;
    color: var(--encre);
    font-family: var(--font-cartouche);
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
}

.primary-menu .current-menu-item > a,
.primary-menu a:hover,
.primary-menu a:focus {
    background: var(--jaune-dup);
    border-color: var(--encre);
    box-shadow: 4px 4px 0 var(--encre);
}

.hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 70px;
    padding: 40px;
    background: var(--papier);
    border: var(--trait) solid var(--encre);
    box-shadow: 15px 15px 0 var(--encre);
}

.hero-img {
    flex: 0 0 200px;
    width: 200px;
    height: 200px;
    overflow: hidden;
    background: var(--jaune-dup);
    border: var(--trait) solid var(--encre);
    box-shadow: 8px 8px 0 var(--encre);
    transform: rotate(-3deg);
}

.hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
}

.hero-text h1,
.page-title,
.entry-title {
    margin: 0;
    color: var(--rouge-dup);
    font-family: var(--font-titre);
    font-size: 3.5rem;
    line-height: 1.1;
    text-transform: uppercase;
}

.entry-title {
    font-size: 2.5rem;
}

.entry-title a {
    color: inherit;
    text-decoration: none;
}

.subtitle,
.entry-meta,
.post-label {
    display: inline-block;
    margin: 15px 0;
    padding: 5px 20px;
    background: var(--encre);
    color: #fff;
    font-family: var(--font-cartouche);
    font-size: 1.5rem;
    font-weight: 700;
    transform: rotate(1deg);
}

.entry-meta,
.post-label {
    font-size: 1.1rem;
}

.vignette,
.comment-respond,
.comments-area .comment-body,
.widget {
    position: relative;
    margin-bottom: 60px;
    padding: 60px 35px 35px;
    background: var(--papier);
    border: var(--trait) solid var(--encre);
    box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.1);
}

.cartouche {
    position: absolute;
    top: -25px;
    left: 20px;
    z-index: 50;
    display: inline-block;
    padding: 8px 25px;
    background-color: var(--jaune-dup);
    border: var(--trait) solid var(--encre);
    box-shadow: 5px 5px 0 var(--encre);
    font-family: var(--font-cartouche);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    transform: rotate(-2deg);
}

.cartouche-blue {
    background-color: var(--bleu-dup);
    color: #fff;
}

.cartouche-dark {
    background-color: var(--encre);
    color: #fff;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-cartouche);
    line-height: 1.2;
}

h2 {
    margin-top: 0;
    font-size: 2.2rem;
}

.doctorat {
    border-left: 15px solid var(--rouge-dup);
}

.ingenierie {
    border-left: 15px solid var(--bleu-dup);
}

.art {
    border-left: 15px solid var(--encre);
}

.bulle-phd {
    position: relative;
    margin: 25px 0;
    padding: 25px;
    background: #fff;
    border: 2px solid var(--encre);
    border-radius: 30px;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

.bulle-phd::after {
    content: "";
    position: absolute;
    bottom: -15px;
    left: 40px;
    border-width: 15px 15px 0 0;
    border-style: solid;
    border-color: var(--encre) transparent;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 25px;
}

.panel-small {
    padding: 20px;
    background: #fff;
    border: 2px solid var(--encre);
}

.contact-panel {
    margin-top: 50px;
    background-color: var(--jaune-dup);
    text-align: center;
}

.btn-bd,
.button,
button,
input[type="submit"] {
    display: inline-block;
    margin: 10px 5px;
    padding: 12px 25px;
    background: var(--encre);
    border: 2px solid var(--encre);
    color: #fff;
    cursor: pointer;
    font-family: var(--font-titre);
    font-size: 1rem;
    text-decoration: none;
    text-transform: uppercase;
}

.btn-bd:hover,
.btn-bd:focus,
.button:hover,
.button:focus,
button:hover,
button:focus,
input[type="submit"]:hover,
input[type="submit"]:focus {
    background: var(--rouge-dup);
    color: #fff;
}

.post-list {
    display: grid;
    gap: 50px;
}

.entry-content > *:first-child {
    margin-top: 0;
}

.entry-content > *:last-child {
    margin-bottom: 0;
}

.entry-content blockquote {
    margin: 25px 0;
    padding: 20px 25px;
    background: #fff;
    border: 2px solid var(--encre);
    border-left: 12px solid var(--rouge-dup);
    font-weight: 700;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.entry-content th,
.entry-content td {
    padding: 10px;
    border: 2px solid var(--encre);
}

.post-thumbnail {
    margin: 25px 0;
}

.post-thumbnail img {
    display: block;
    border: var(--trait) solid var(--encre);
    box-shadow: 8px 8px 0 var(--encre);
}

.page-links,
.nav-links,
.pagination {
    margin: 30px 0;
    font-family: var(--font-cartouche);
    font-weight: 700;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.wp-block-search__inside-wrapper,
.search-form {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="password"],
textarea {
    width: 100%;
    padding: 12px 14px;
    background: #fff;
    border: 2px solid var(--encre);
    color: var(--encre);
    font-size: 1.1rem;
}

textarea {
    min-height: 160px;
}

.site-footer {
    margin-top: 40px;
    background: var(--encre);
    color: #fff;
}

.site-footer a {
    color: var(--jaune-dup);
}

.site-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 18px;
}

#knowledge-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    display: flex;
    width: 320px;
    flex-direction: column;
    align-items: flex-end;
}

.knowledge-avatar {
    position: relative;
    width: 110px;
    height: 110px;
    overflow: hidden;
    padding: 0;
    background: var(--jaune-dup);
    border: 4px solid var(--encre);
    border-radius: 50%;
    box-shadow: 6px 6px 0 var(--encre);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.knowledge-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
}

.knowledge-avatar:hover,
.knowledge-avatar:focus {
    transform: scale(1.1) rotate(5deg);
}

.knowledge-bubble {
    position: relative;
    display: none;
    width: 100%;
    margin-bottom: 15px;
    padding: 20px;
    background: #fff;
    border: 3px solid var(--encre);
    border-radius: 25px;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.knowledge-bubble.is-visible {
    display: block;
}

.knowledge-bubble::after {
    content: "";
    position: absolute;
    right: 40px;
    bottom: -15px;
    border-width: 15px 15px 0 0;
    border-style: solid;
    border-color: var(--encre) transparent;
}

.bubble-header {
    border-bottom: 1px solid #eee;
    color: var(--rouge-dup);
    font-family: var(--font-cartouche);
    font-weight: 700;
}

#fact-text {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.bubble-hint {
    margin-top: 5px;
    color: #666;
    font-size: 0.8rem;
    text-align: right;
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-list .children {
    list-style: none;
    margin-left: 30px;
    padding-left: 0;
}

.comment-meta {
    font-family: var(--font-cartouche);
    font-weight: 700;
}

.widget-area {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.sticky {
    border-left: 15px solid var(--jaune-dup);
}

.bypostauthor {
    border-left-color: var(--bleu-dup);
}

.alignwide,
.alignfull {
    max-width: 100%;
}

@media (max-width: 768px) {
    body {
        font-size: 1.15rem;
    }

    .site-header-inner,
    .hero,
    .site-footer-inner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .menu-toggle {
        display: inline-block;
        align-self: center;
    }

    .main-navigation {
        width: 100%;
    }

    .primary-menu {
        display: none;
        margin-top: 18px;
        flex-direction: column;
    }

    .main-navigation.is-open .primary-menu {
        display: flex;
    }

    .hero-text h1,
    .page-title {
        font-size: 2.5rem;
    }

    .entry-title {
        font-size: 2rem;
    }

    .grid-3,
    .widget-area {
        grid-template-columns: 1fr;
    }

    #knowledge-container {
        width: 260px;
    }

    .nav-links,
    .wp-block-search__inside-wrapper,
    .search-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .site-container,
    .container {
        padding: 28px 14px;
    }

    .hero,
    .vignette,
    .comment-respond,
    .comments-area .comment-body,
    .widget {
        padding-right: 22px;
        padding-left: 22px;
    }

    .hero {
        box-shadow: 8px 8px 0 var(--encre);
    }

    .cartouche {
        max-width: calc(100% - 40px);
        font-size: 1.2rem;
    }

    #knowledge-container {
        right: 12px;
        bottom: 12px;
        width: 220px;
    }

    .knowledge-avatar {
        width: 88px;
        height: 88px;
    }
}
