/*
 * styles.css Règles de style pour le site Inter-Foyers Ruraux
 *
 * Copyright (C) 2025 Félicien Pillot <felicien@informatiquelibre.fr>
 * 
 * This is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This file is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this file.  If not, see <http://www.gnu.org/licenses/>.
 */

html
{
    margin: 0;
    padding: 0;
    height: 100%;
    scroll-behavior: smooth;
    font-family: Cantarell, sans-serif;
    font-size: 18px;
    background: lightgrey;
}

body
{
    margin: 0;
    display: flex;
    flex-flow: column;
    min-height: 100vh;
    background: white;
}

/*
 * En-tête
 */

h1
{
    text-align: center;
    font-size: 40px;
}

h2 {
    margin: 0;
    font-size: 1.5em;
}

img.entete {
    width: 100%;
}

.titre {
    position: absolute;
    margin-left: 0.3em;
    color: white;
    width: 100%;
    font-weight: 700;
    .grand_ecran {
	display: none;
    }
    img {
	float: left;
	width: 70px;
	margin-right: 0.2em;
    }
    ul {
	margin: 0.3em;
	width: fit-content;
    }
    li {
	border-radius: 6px;
	opacity: 0.8;
	margin: 0.1em 0;
    }
}

.menu {
    background-color: var(--bg-primary);
    color: var(--fg-primary);
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.menu .logo {
    margin: 0 0.5em;
    font-size: 1.4em;
    font-weight: bold;
    a {
	text-decoration: none;
	color: var(--fg-primary);
    }
    img {
	width: 5vw;
	display: block;
	margin: auto;
    }
    span {
	display: none;
    }
}

.menu-links {
  list-style: none;
  display: none;
  flex-direction: column;
  background-color: #333;
  padding: 0;
  position: absolute;
  top: 32px;
  left: 0;
  width: 100%;
  transition: all 0.3s ease;
}

.menu-links li {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-links a {
  color: #fff;
  text-decoration: none;
  padding: 12px 0;
  display: block;
  font-size: 1.1em;
  font-weight: 500;
  transition: color 0.3s ease;
}

.menu-links a:hover {
  color: #00bcd4 !important;
}

.menu-toggle {
  display: block;
  font-size: 1.8em;
  cursor: pointer;
}

.sousmenu {
    padding: 12px 0;
}

.sousmenu_contenu {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
  margin-top: 25px;
}

.sousmenu_contenu a {
  float: none;
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
}

.sousmenu:hover .sousmenu_contenu {
  display: block;
}

/* État actif du menu (quand on clique sur le burger) */
.menu.active .menu-links {
  display: flex;
}

/* Version tablette */
@media (min-width: 700px) {

    h1 {
	font-size: 40px;
    }
    
    h2
    {
	margin: 0.4em 0 0 0;
	font-size: 2em;
    }
    
    h3
    {
	font-size: 1.5em;
	margin: 0;
    }

    .menu {
	flex-direction: row;
    }

  .menu .logo span {
      display: block;
  }

  .menu-links {
    display: flex !important;
    position: static;
    flex-direction: row;
    background: none;
    margin: 0 50px;
    justify-content: space-evenly;
    align-items: center;
  }

  .menu-links a {
      padding: 10px;
      small {
	  display: none;
      }
  }

  .sousmenu {
      padding: 10px !important;
      position: relative;
  }

  .sousmenu::after {
      writing-mode: vertical-rl;
      content: "";
      width: 0px;
      height: 0px;
      border-style: solid;
      border-width: 10px;
      border-color: transparent var(--bg-primary) var(--bg-primary) var(--bg-primary);
      position: absolute;
      background-color: inherit;
      margin-left: -52%;
      bottom: -31%;
  }
  
  .menu-links li {
    border: none;
    padding: 0;
  }

  .menu-toggle {
    display: none;
  }
}

/* Version bureau */
@media (min-width: 976px) {
    .menu-links a small {
	display: block;
    }
    .grand_ecran {
	display: block !important;
    }
}

/*
 * Contenu des pages
 */

article
{
    flex: 1 1 auto;
    margin: 1em 0;
}

/*
 * Actualités
 */

.actus_conteneur
{
    display: flex;
    flex-flow: column;
    align-items: center;
}


.actu {
    width: 300px;
    margin: 1em;
    border-radius: 5px;
    background-color: #fff;
    box-shadow: black 0px 3px 10px;
    transition: transform .4s;
    overflow: hidden;
    &:hover{
	transform: scale(1.05);
    }
}

.titre_actu {
    margin: 0;
    padding: 0.5em;
    text-align: center;
    background-color: grey;
    color: #fff;
}

.soustitre_actu, .contenu_actu {
    margin: 0.4em;
}

.soustitre_actu h4 {
    margin: 0.2em;
    text-decoration: underline;
}

.contenu_actu {
    max-height: 300px;
    text-overflow: ellipsis;
}

.grande_actu {
    overflow: visible;
    max-height: fit-content;
}

.popup {
    transition: all 0.4s linear;
}

/* Version Desktop */
@media (min-width: 768px) {
    article
    {
	margin: 1em;
    }
    
    .actus_conteneur
    {
	flex-flow: row;
	flex-wrap: wrap;
	justify-content: center;
    }
    
    .overview
    {
	position: fixed;
	display: flex;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0,0,0,0.8);
	z-index: 20;
    }
    
    .hidden
    {
	display: none;
    }
    
    .popup {
	position: relative;
	margin: auto;
	z-index: 21;
	width: 70%;
	height: 70%;
	overflow: scroll;
	background-color: white;
    }
}

/*
 * Page d'édition
 */

.liste_boutons {
    display: flex;
    flex-flow: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    a {
	padding: 8px 4px;
	border: 1px outset buttonborder;
	border-radius: 3px;
	color: buttontext;
	background-color: buttonface;
	text-decoration: none;
	text-align: center;
    }
}

/*
 * Formulaire d'ajout d'actualités
 */

.formulaire
{
    display: flex;
    flex-flow: column;
    margin: 1em auto;
}

.ligne_form
{
    flex: 1 1 auto;
    margin: 0.3em auto;
}

input[type=checkbox]:checked~.cache {
    display: block;
}

.cache {
    display: none;
}

input[type=submit] {
    margin: 1em;
    padding: 5px;
    font-weight: bold;
    font-size: 1em;
    background-color: var(--bg-primary);
    color: var(--fg-primary);
}

/*
 * Pied de page
 */

footer
{
    flex: 0 1 40px;
    padding: 1em;
    border-top: 1px solid black;
    background-color: var(--bg-primary);
    color: var(--fg-primary);
    a {
	color: inherit
    }
}
