/* Common CSS to copy paste everywhere */

@import url('https://fonts.cdnfonts.com/css/top-secret-stamp');
@import url('https://fonts.cdnfonts.com/css/cocogoose');

@font-face {
    font-family: 'TypewriterPress';
    src: url('../font/TypewriterPress-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'AltoneTrial';
    src: url('../font/AltoneTrial-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --transition: all 0.4s ease;
    /* dark mode */
    --black: #1B1B1E;
    --red: #96031A;
    --yellow: #FAA916;
    --grey: #D5C9BD;
    --green: #283A47;
    --white: #FFF8F0;
    --font-headline: 'Top Secret Stamp', sans-serif;
    --font-headline-bis: 'COCOGOOSE', sans-serif;
    --font-subtitle: 'TypewriterPress', sans-serif;
    --font-text: 'AltoneTrial', sans-serif;
    --font-size-h1: 3rem;
    --font-size-h2: 2rem;
    --font-size-h3: 1.5rem;
    --font-size-p: 1.2rem;
}

* {
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Fix pour le footer */
html, body {
    height: 100%;
    margin: 0;
    font-family: var(--font-text);
    font-size: 16px;
}

body {
    display: flex;
    flex-direction: column;
    transition: background-color 0.4s ease, color 0.4s ease;
    background: var(--green);
    position: relative;
}

#home-page {
    flex: 1 0 auto;
    position: relative;
    z-index: auto;
    background: var(--green);
}

footer {
    flex-shrink: 0;
}
/* Fin du fix pour le footer */

.light-mode h1 {
    color: #283A47;
}

h1 {
    margin: 0;
    font-size: var(--font-size-h1);
    font-family: var(--font-headline);
    color: var(--green);
}

h2 {
    font-family: var(--font-subtitle);
    font-size: var(--font-size-h2)
}

h3 {
    font-family: var(--font-subtitle);
    font-size: var(--font-size-h3)
}

p {
    font-size: 1.2rem;
}

/* light mode */
body.light-mode {
    --black: #FFF8F0;
    --white: #1B1B1E;
    --green: #FFF8F0;
}

/* Transition des autres éléments si nécessaire */
body {
    transition: background-color 0.4s ease, color 0.4s ease;
    background: var(--green);
}

.light-mode body {
    background: var(--black);
}

::selection {
    background-color: var(--yellow);
    color: var(--black);
}

body,
html {
    margin: 0;
    font-family: var(--font-text);
    font-size: 16px;
    height: 1080px;
    width: auto;
}

.transition-active {
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* ---------- HEADER ---------- */

header {
    background-color: var(--black);
    padding: 0 100px;
}

.light-mode header,
.light-mode footer {
    background-color: var(--grey);
}

header a,
header p,
header li {
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s ease;
}

header a:hover,
header #button-rub-menu:hover {
    text-decoration: line-through;
    transition: all 0.3s ease;
}

#first-header {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--white);
}

.first-header-sous {
    display: flex;
    gap: 20px;
    align-items: center;
}

#logo-header {
    width: 60px;
}

#logo-header path {
    fill: var(--white);
}

#icon-person svg {
    height: auto;
    width: 35px;
    fill: var(--white);
    transition: var(--transition);
}

#icon-person svg:hover {
    fill: var(--yellow);
    transition: var(--transition);
}

.light-mode #icon-person svg:hover {
    fill: var(--red);
}

.link-button {
    background: var(--yellow);
    color: var(--white);
    padding: 10px;
    border-radius: 100px;
}

#second-header ul {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    list-style-type: none;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 100;
}

/* SOUS MENU */

#button-rub-menu, #button-cat-menu {
    cursor: pointer;
    position: relative;
    z-index: 100;
    padding: 5px 15px;
    border-radius: 20px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#button-rub-menu:hover, #button-cat-menu:hover {
    background-color: rgba(150, 3, 26, 0.2);
    transform: translateY(-2px);
}

#rub-menu, #cat-menu {
    max-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 0 20px;
    position: absolute;
    border-radius: 30px;
    background-color: var(--black);
    transition: max-height 0.3s ease-out, padding 0.3s ease-out, transform 0.2s ease;
    z-index: 100;
    width: 260px;
    left: calc(50% - 150px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

#cat-menu {
    transform: translateY(270px);
}

.light-mode #rub-menu, .light-mode #cat-menu {
    background: var(--grey);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

#rub-menu.active, #cat-menu.active {
    max-height: 700px;
    padding: 20px;
}

#cat-menu.active {
    transform: translateY(270px) scale(1);
}

#rub-menu li, #cat-menu li {
    padding: 10px 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

#rub-menu li:hover, #cat-menu li:hover {
    transform: translateX(5px);
}

#rub-menu a, #cat-menu a {
    display: block;
    width: 100%;
    padding: 5px 0;
}

header form button {
    border: none;
    background: none;
}

header form {
    width: 180px;
    height: 30px;
    display: flex;
    align-items: center;
    padding-inline: 0.8em;
    border-radius: 100px;
    transition: border-radius 0.5s ease;
    background: var(--white)
}

.light-mode header form {
    outline: 2px solid var(--white);
    background: var(--black)
}

header form input {
    font-size: 0.9rem;
    background-color: transparent;
    width: 100%;
    height: 100%;
    padding-inline: 0.5em;
    padding-block: 0.7em;
    border: none;
}

header form:before {
    content: "";
    position: absolute;
    transform: scaleX(0);
    transform-origin: center;
    width: 100%;
    height: 30px;
    left: 0;
    bottom: 0;
    border-radius: 5px;
    transition: transform 0.3s ease;
}

header form:focus-within {
    border-radius: 5px;
}

header form input:focus {
    outline: none;
}

/* here is code of animated border */
header form:focus-within:before {
    transform: scale(1);
}

.reset {
    border: none;
    background: none;
    opacity: 0;
    visibility: hidden;
}

/* close button shown when typing */
input:not(:placeholder-shown)~.reset {
    opacity: 1;
    visibility: visible;
}

/* sizing svg icons */
header form svg {
    width: 17px;
    margin-top: 3px;
}

/* LIGHT MODE BUTTON */
.toggle-switch {
    position: relative;
    width: 70px;
    height: 30px;
}

.switch-label {
    position: absolute;
    width: 100%;
    height: 30px;
    background-color: var(--white);
    border-radius: 25px;
    cursor: pointer;
}

.checkbox {
    position: absolute;
    display: none;
}

.slider {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 25px;
    -webkit-transition: 0.3s;
    transition: 0.3s;
}

.checkbox:checked~.slider {
    background-color: var(--white);
}

.slider::before {
    content: "";
    position: absolute;
    top: 5px;
    left: -5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    -webkit-box-shadow: inset 12px -4px 0px 0px var(--black);
    box-shadow: inset 12px -4px 0px 0px var(--black);
    background-color: var(--black);
    -webkit-transition: 0.3s;
    transition: 0.3s;
    -webkit-transform: translateX(50px);
    -ms-transform: translateX(50px);
    transform: translateX(50px);
}

.checkbox:checked~.slider::before {
    -webkit-transform: translateX(10px);
    -ms-transform: translateX(10px);
    transform: translateX(10px);
    background-color: var(--black);
    -webkit-box-shadow: none;
    box-shadow: none;
}

#post-header {
    width: 100vw;
    margin: 0 0 50px 0 ;
}

/*  LOG HEADER  */

#account {
    padding: 10px;
    gap: 8px;
    top: 60px;
    position: absolute;
    display: none;
    flex-direction: column;
    background-color: var(--black);
    align-items: center;
    border: 1px solid var(--yellow);
    border-radius: 10px;
}

#account.active {
    display: flex;
}

.light-mode #account {
    border: 1px solid var(--red);
}

/* ---------- FOOTER ---------- */

#pre-footer {
    width: 100vw;
    margin: 100px 0 0 0;
}

footer {
    background-color: var(--black);
    padding: 40px 100px 20px;
    color: var(--white);
    width: 100%;
    box-sizing: border-box;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.footer-brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
}

.footer-logo {
    width: 120px;
    height: auto;
}

.social {
    display: flex;
    position: relative;
    width: 108px;
    height: 28px;
}

.social a {
    display: block;
}

.social img {
    width: 28px;
    height: 28px;
}

.social .icon {
    position: absolute;
    top: 0;
    left: 0;
}

.social .icon1 {
    position: absolute;
    top: 0;
    left: 40px;
}

.social .icon2 {
    position: absolute;
    top: 0;
    left: 80px;
}

.footer-nav {
    display: flex;
    gap: 80px;
}

.footer-nav-section h4 {
    margin-top: 0;
    margin-bottom: 20px;
    font-family: var(--font-subtitle);
    font-size: 18px;
}

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

.footer-nav-section li {
    margin-bottom: 10px;
}

.footer-nav-section a {
    color: var(--white);
    text-decoration: none;
    font-family: var(--font-text);
    line-height: 19px;
}

.footer-copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid var(--white);
    font-size: 14px;
    font-family: var(--font-text);
}

#footer-logo path {
    fill: var(--white);
      width: 120px; 
    height: auto;
}
  
/* HOME PAGE */

#home-page {
    position: relative;
    z-index: auto;
}

#presentation {
    width: 85%;
    margin: auto;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-align: center;
    justify-items: center;
    position: relative;
    z-index: 1;
}

.light-mode #presentation p {
    color: var(--white);
}

#presentation-content {
    margin: auto;
    z-index: 1;
    padding: 20px;
    border-radius: 10px;
    color: var(--black);
    grid-row: 1;
    grid-column: 1;
    position: relative;
    width: 80%;
    top: -30px;
}

#background-image {
    width: -webkit-fill-available;
    object-fit: cover;
    z-index: 0;
    grid-row: 1;
    grid-column: 1;
}

#article {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10vh 0;
    height: auto;
    min-height: 70vh;
    color: var(--white);
    position: relative;
    z-index: 2;
}

.light-mode #article {
    color: var(--black);
}

#article h2 {
    margin-top: 100px;
    position: relative;
    z-index: 2;
}

#article-carousel {
    display: grid;
    grid-template-columns: 20% 60% 20%;
    background: url('../images/portrait-example.jpg');
    background-repeat: no-repeat;
    background-position: bottom;
    background-size: cover;
    height: 100%;
}

#fire {
    width: 15px;
    fill: var(--white);
}

.light-mode #fire {
    fill: var(--black);
}

#info-article {
    margin-top: 30vh;
    width: 65%;
    grid-column: 2;
}

.categorie-button {
    background-color: var(--red);
    border-radius: 50px;
    width: fit-content;
    position: relative;
    z-index: 2;
}

.button-more {
    border: 1px solid var(--white);
    border-radius: 50px;
    width: fit-content;
    position: relative;
    z-index: 2;
}

.light-mode .button-more {
    border: 1px solid var(--black);
}

.categorie-button p, .button-more p {
    padding: 5px 10px;
    margin: 0;
}

.article-card {
    margin-top: 3rem;
    width: 90%;
    background-color: rgba(27, 27, 30, 0.9);
    padding: 2rem;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

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

.article-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    margin-bottom: 1rem;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.1);
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

#articles-container {
    position: relative;
    z-index: 3;
}

#portrait-conteneur {
    margin: 0 15vw;
    display: grid;
    grid-template-columns: 40% 60%;
    grid-template-rows: 30% 40% 30%;
    min-height: 400px;
    align-items: center;
    justify-items: center;
}


#background-portrait {
    width: 90%;
    min-height: 400px;
    margin: auto;
    grid-row: 1/4;
    grid-column: 1/3;
}

#image-portrait {
    width: 70%;
    grid-row: 1 / 4;
    grid-column: 1;
    margin-left: 70px;
}

#h2-portrait {
    margin: 0;
    grid-column: 2;
    grid-row: 1;
    color: var(--red);
}

#p-portrait {
    grid-column: 2;
    grid-row: 2;
    width: 80%;
    font-size: 1rem;
}

#portrait .button-more {
    grid-column: 2;
    grid-row: 3;
    border-color: var(--black);
}

.light-mode #portrait .button-more {
    border-color: var(--white);
}

#welcome h1 {
    color: var(--white);
    margin: auto;
    text-align: center;
}

#welcome h1 span {
    text-transform: uppercase;
}

/* Styles des cartes d'articles */
#articles-container a:hover .article-card {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

#articles-container a:hover .button-more {
    background-color: var(--red);
}

.light-mode #articles-container a:hover .button-more {
    background-color: var(--yellow);
    color: var(--black);
}

/* Fix pour les chiffres qui s'affichent avec des images */
.digit, 
span:has(.digit),
span.digit,
.page-number,
.page-indicator,
[data-page],
span:has([data-page]) {
    font-family: Arial, Helvetica, sans-serif !important;
}

/* Chiffres dans d'autres éléments */
.categorie-button p span,
#page-indicator,
#footer span,
.article-content span {
    font-family: Arial, Helvetica, sans-serif !important;
}

/* Chiffres dans les dates */
.article-card .categorie-button p {
    font-family: Arial, Helvetica, sans-serif !important;
}

/* Forcer l'affichage des chiffres sans images */
[class*="digit"],
[class*="number"],
span:has([class*="digit"]),
span:has([class*="number"]) {
    font-family: Arial, Helvetica, sans-serif !important;
}