/* =========================================================
   TOKENS — shared site-wide (home.css relies on these too)
   ========================================================= */
:root{
  --ink:        #16302B;
  --ink-soft:   #4A5D58;
  --bg:         #F6F7F2;
  --paper:      #FFFFFF;
  --teal:       #1F5D53;
  --teal-dark:  #123A33;
  --teal-tint:  #E7F0EC;
  --gold:       #D8A34E;
  --gold-tint:  #F7ECD8;
  --brick:      #C1594A;
  --brick-dark: #A64637;
  --line:       rgba(22,48,43,0.12);
  --shadow:     0 10px 30px rgba(18,58,51,0.08);
  --shadow-lift:0 18px 40px rgba(18,58,51,0.14);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Work Sans', -apple-system, sans-serif;
  --font-utility: 'IBM Plex Mono', monospace;

  --header-h: 76px;
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container{
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.block-content{
  flex: 1;
}

a{ color: inherit; }

/* =========================================================
   HEADER / NAVBAR
   ========================================================= */
.header{
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246,247,242,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.navbar{
  height: var(--header-h);
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img{
  height: 42px;
  width: auto;
  display: block;
}

.menu{
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.menu li a{
  display: inline-block;
  padding: 10px 16px;
  font-family: var(--font-utility);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  border-radius: 3px;
  position: relative;
  transition: color 0.2s;
}

.menu li a::after{
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 6px;
  height: 2px;
  background: var(--brick);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.menu li a:hover{
  color: var(--ink);
}
.menu li a:hover::after{
  transform: scaleX(1);
}

.menu-contact{
  background: var(--teal);
  color: #fff !important;
  border-radius: 3px;
}
.menu-contact::after{ display: none; }
.menu-contact:hover{
  background: var(--teal-dark);
  color: #fff !important;
}

.menu-toggle{
  display: none;
  font-size: 1.6rem;
  color: var(--teal);
  cursor: pointer;
  line-height: 1;
}

@media (max-width: 860px){
  .menu-toggle{ display: block; }

  .menu{
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .menu.active{
    max-height: 400px;
  }
  .menu li{
    border-top: 1px solid var(--line);
  }
  .menu li a{
    display: block;
    padding: 16px 24px;
    border-radius: 0;
  }
  .menu li a::after{ display: none; }
  .menu-contact{
    margin: 12px 24px;
    text-align: center;
  }
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer{
  background: var(--teal-dark);
  color: rgba(255,255,255,0.82);
  position: relative;
}
.site-footer::before{
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--brick));
}

.footer-inner{
  max-width: 1240px;
  margin: 0 auto;
  padding: 64px 24px 32px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand img{
  height: 36px;
  margin-bottom: 16px;
  filter: brightness(0) invert(1);
}
.footer-brand p{
  font-size: 0.92rem;
  color: rgba(255,255,255,0.65);
  max-width: 280px;
  margin: 0;
}

.footer-col h4{
  font-family: var(--font-utility);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 18px;
  font-weight: 500;
}

.footer-col ul{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col ul li a{
  text-decoration: none;
  font-size: 0.92rem;
  color: rgba(255,255,255,0.78);
  transition: color 0.2s;
}
.footer-col ul li a:hover{
  color: var(--gold);
}

.footer-social{
  display: flex;
  gap: 14px;
  margin-top: 4px;
}
.footer-social a{
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.footer-social a:hover{
  background: var(--gold);
  border-color: var(--gold);
  color: var(--teal-dark);
}

.footer-bottom{
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 20px 24px;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-utility);
  font-size: 0.76rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.02em;
}
.footer-bottom a{
  color: rgba(255,255,255,0.6);
  text-decoration: none;
}
.footer-bottom a:hover{
  color: var(--gold);
}

@media (max-width: 860px){
  .footer-inner{
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand{
    grid-column: 1 / -1;
  }
}
@media (max-width: 520px){
  .footer-inner{
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   ACCESSIBILITY
   ========================================================= */
a:focus-visible, button:focus-visible, .menu-toggle:focus-visible{
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ transition: none !important; }
}

/* =========================================================
   PAGE SHELL — wraps inner pages (lists, forms, detail views)
   so they get the same centered rhythm as the homepage sections
   ========================================================= */
.page-shell{
  max-width: 1000px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}
.page-shell h1{
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 1.9rem;
  margin: 0 0 32px;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn-ajout,
.btn-filter,
.btn-submit,
.btn-more{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
  border: 1.5px solid transparent;
}

.btn-ajout,
.btn-submit{
  background: var(--teal);
  color: #fff;
  padding: 11px 20px;
}
.btn-ajout:hover,
.btn-submit:hover{
  background: var(--teal-dark);
}

.btn-filter{
  background: var(--paper);
  color: var(--teal);
  border-color: var(--teal);
  padding: 9px 18px;
}
.btn-filter:hover{
  background: var(--teal);
  color: #fff;
}

.btn-more{
  color: var(--brick);
  border-color: var(--brick);
  padding: 10px 18px;
  background: transparent;
}
.btn-more:hover{
  background: var(--brick);
  color: #fff;
}

.lien-modifier{
  display: inline-block;
  font-family: var(--font-utility);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--teal);
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid var(--teal);
  border-radius: 20px;
  transition: background 0.2s, color 0.2s;
}
.lien-modifier:hover{
  background: var(--teal);
  color: #fff;
}

/* =========================================================
   FORM FIELDS — inputs, selects, textareas outside Django Forms
   as well as inside them
   ========================================================= */
.page-shell input[type="text"],
.page-shell input[type="date"],
.page-shell input[type="email"],
.page-shell input[type="password"],
.page-shell select,
.page-shell textarea{
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 9px 12px;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.page-shell input:focus,
.page-shell select:focus,
.page-shell textarea:focus{
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-tint);
}

.toolbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.filter-form{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-form input,
.filter-form select{
  width: auto;
  min-width: 150px;
}

.form-card{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
  padding: 36px;
  max-width: 720px;
}
.field-group{
  margin-bottom: 22px;
}
.field-group label{
  display: block;
  font-family: var(--font-utility);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.field-error{
  color: var(--brick-dark);
  font-size: 0.82rem;
  margin: 6px 0 0;
}

/* =========================================================
   TABLE — admin-style lists (actualités, articles...)
   ========================================================= */
.table-wrap{
  background: var(--paper);
  border-radius: 4px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.app-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.app-table thead th{
  background: var(--teal-tint);
  color: var(--teal-dark);
  font-family: var(--font-utility);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  font-weight: 500;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.app-table td{
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: middle;
}
.app-table tbody tr:last-child td{
  border-bottom: none;
}
.app-table tbody tr:hover td{
  background: rgba(31,93,83,0.04);
}
.app-table .cell-muted{
  color: var(--ink-soft);
  font-size: 0.82rem;
}
.app-table .empty-row td{
  text-align: center;
  padding: 40px 18px;
  color: var(--ink-soft);
  font-style: italic;
}