/*
Theme Name:  CDTA 37
Theme URI:   https://cdta37.fr
Author:      Mickaël Maudoigt
Author URI:  https://cdta37.fr
Description: Thème officiel du Comité Départemental de Tir à l'Arc d'Indre-et-Loire.
Version:     1.1.0
License:     GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cdta
Tags:        custom-colors, custom-menu, featured-images, responsive-layout
*/

/* ── CDTA Design Tokens ────────────────────────────────────────────────────── */
:root {
  --cdta-navy:    #001F5C;
  --cdta-blue:    #003087;
  --cdta-blue-light: #1265B8;
  --cdta-gold:    #D4A017;
  --cdta-gold-dark: #a67c00;
  --cdta-red:     #C8102E;
  --cdta-bg:      #EEF1F5;
  --cdta-surface: #FFFFFF;
  --cdta-text:    #1A2035;
  --cdta-muted:   #6C7B8A;
  --cdta-border:  #DDE3ED;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,.07);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.16);

  --nav-h: 6.5rem;
  --container: 1200px;
}

/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Maven Pro', 'Segoe UI', Roboto, Arial, sans-serif;
  background-color: var(--cdta-bg);
  color: var(--cdta-text);
  font-size: 16px;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: var(--cdta-blue); text-decoration: none; transition: color .18s; }
a:hover { color: var(--cdta-gold); }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Maven Pro', sans-serif;
  margin-top: 0;
  margin-bottom: .75rem;
  color: var(--cdta-navy);
  line-height: 1.3;
}

p { margin-top: 0; margin-bottom: 1rem; }

ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }

/* ── Layout ────────────────────────────────────────────────────────────────── */
.site         { display: flex; flex-direction: column; min-height: 100vh; }
.site-content { flex: 1; padding: 2.5rem 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.content-area  { flex: 1; min-width: 0; }
.widget-area   { width: 300px; flex-shrink: 0; }

.has-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

/* ── Site Header ───────────────────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(135deg, #1265B8 0%, #003087 50%, #001F5C 100%);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  overflow: visible;
}

.site-header .container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-block: 0;
}

/* Rangée 1 : logo + brand */
.nav-brand-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  height: var(--nav-h);
}

/* Logo / Brand */
.site-branding {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

.custom-logo-link {
  display: flex;
  align-items: center;
}

.custom-logo-link img {
  height: 94px;
  width: auto;
  max-width: 100%;
  display: block;
}

.brand-text-link {
  text-decoration: none;
}

.site-branding .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-sub  {
  font-size: .65rem;
  color: rgba(255,255,255,.6);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.brand-name {
  font-size: 1.05rem;
  color: #fff;
  font-weight: 700;
}

/* Nav spacer */
.header-spacer { flex: 1; }

/* ── Navigation principale ─────────────────────────────────────────────────── */
.main-navigation {
  display: flex;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,.12);
  padding: .35rem 0;
}

.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: .25rem;
}

.main-navigation ul li { position: relative; }

.main-navigation ul li a {
  display: flex;
  align-items: center;
  padding: .5rem .65rem;
  font-size: .9rem;
  font-weight: 500;
  color: rgba(255,255,255,.85);
  border-radius: var(--radius-sm);
  transition: background .18s, color .18s;
  white-space: nowrap;
}

.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item > a,
.main-navigation ul li.current-page-ancestor > a {
  background: rgba(255,255,255,.15);
  color: #fff;
}

.main-navigation ul li.current-menu-item > a {
  background: rgba(212,160,23,.2);
  color: var(--cdta-gold);
}

/* Sous-menus */
.main-navigation ul ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--cdta-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  flex-direction: column;
  gap: 0;
  padding: .4rem;
  padding-top: .7rem;
  z-index: 999;
}

.main-navigation ul li:hover > ul { display: flex; }

.main-navigation ul ul li a {
  color: var(--cdta-text);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  font-size: .875rem;
}

.main-navigation ul ul li a:hover {
  background: #EEF4FF;
  color: var(--cdta-blue);
}

/* Burger */
.menu-toggle {
  display: none;
  background: rgba(255,255,255,.15);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
  padding: .5rem .75rem;
  font-size: 1.25rem;
  line-height: 1;
  transition: background .18s;
}
.menu-toggle:hover { background: rgba(255,255,255,.25); }

/* ── Page title bar ────────────────────────────────────────────────────────── */
.page-title-bar {
  background: var(--cdta-surface);
  border-bottom: 1px solid var(--cdta-border);
  padding: 1.25rem 0;
  margin-bottom: 0;
}

.page-title-bar h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cdta-blue);
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-bottom: .6rem;
  border-bottom: 3px solid var(--cdta-gold);
  display: inline-flex;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--cdta-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-body   { padding: 1.5rem; }
.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--cdta-border);
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  color: var(--cdta-blue);
}

/* ── Posts list ────────────────────────────────────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.post-card { display: flex; flex-direction: column; }

.post-card .post-thumbnail img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-card .post-thumbnail-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--cdta-blue) 0%, var(--cdta-navy) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.3);
  font-size: 3rem;
}

.post-card .card-body { flex: 1; display: flex; flex-direction: column; }

.post-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .8rem;
  color: var(--cdta-muted);
  margin-bottom: .75rem;
  flex-wrap: wrap;
}

.post-meta .cat-badge {
  background: rgba(0,48,135,.1);
  color: var(--cdta-blue);
  border-radius: var(--radius-xs);
  padding: .15rem .5rem;
  font-weight: 600;
  font-size: .75rem;
}

.post-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cdta-navy);
  margin-bottom: .6rem;
  line-height: 1.4;
}

.post-title a { color: inherit; }
.post-title a:hover { color: var(--cdta-blue); }

.post-excerpt {
  color: var(--cdta-muted);
  font-size: .9rem;
  flex: 1;
  margin-bottom: 1rem;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--cdta-blue);
  margin-top: auto;
}

.read-more:hover { color: var(--cdta-gold); gap: .55rem; }

/* ── Article single ────────────────────────────────────────────────────────── */
.entry-header { margin-bottom: 2rem; }

.entry-header .entry-title {
  font-size: 2rem;
  color: var(--cdta-navy);
  border-bottom: 3px solid var(--cdta-gold);
  padding-bottom: .75rem;
  margin-bottom: 1rem;
}

.entry-featured-image {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 2rem;
}

.entry-featured-image img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}

.entry-content {
  font-size: 1rem;
  line-height: 1.8;
}

.entry-content h2 { font-size: 1.5rem; margin-top: 2rem; color: var(--cdta-blue); }
.entry-content h3 { font-size: 1.25rem; margin-top: 1.5rem; }

.entry-content blockquote {
  border-left: 4px solid var(--cdta-gold);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: rgba(212,160,23,.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--cdta-text);
  font-style: italic;
}

.entry-content pre {
  background: var(--cdta-navy);
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: .875rem;
}

.entry-content code {
  background: rgba(0,48,135,.08);
  color: var(--cdta-blue);
  padding: .1em .35em;
  border-radius: 4px;
  font-size: .9em;
}

.entry-content pre code { background: none; color: inherit; padding: 0; }

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.entry-content table th {
  background: var(--cdta-blue);
  color: #fff;
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 600;
}

.entry-content table td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--cdta-border);
}

.entry-content table tr:nth-child(even) td { background: #f8f9fc; }
.entry-content table tr:hover td { background: #EEF4FF; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .18s, color .18s, border-color .18s, box-shadow .18s;
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--cdta-blue);
  color: #fff;
  border-color: var(--cdta-blue);
}
.btn-primary:hover {
  background: var(--cdta-navy);
  border-color: var(--cdta-navy);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,48,135,.3);
}

.btn-gold {
  background: var(--cdta-gold);
  color: var(--cdta-navy);
  border-color: var(--cdta-gold);
}
.btn-gold:hover {
  background: var(--cdta-gold-dark);
  border-color: var(--cdta-gold-dark);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--cdta-blue);
  border-color: var(--cdta-blue);
}
.btn-outline:hover {
  background: var(--cdta-blue);
  color: #fff;
}

/* ── Tags & badges ─────────────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  background: rgba(0,48,135,.1);
  color: var(--cdta-blue);
  border-radius: var(--radius-xs);
  padding: .2rem .6rem;
  font-size: .78rem;
  font-weight: 600;
}

.tag-gold {
  background: rgba(212,160,23,.15);
  color: var(--cdta-gold-dark);
}

/* ── Pagination ────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .4rem;
  margin: 2rem 0;
}

.pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  color: var(--cdta-text);
  background: var(--cdta-surface);
  box-shadow: var(--shadow-sm);
  transition: background .18s, color .18s;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--cdta-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,48,135,.3);
}

.pagination .page-numbers.current { background: var(--cdta-gold); color: var(--cdta-navy); }

/* ── Sidebar / Widgets ─────────────────────────────────────────────────────── */
.widget-area .widget {
  background: var(--cdta-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.widget .widget-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--cdta-blue);
  padding: .9rem 1.25rem;
  margin: 0;
  border-bottom: 1px solid var(--cdta-border);
  border-left: 4px solid var(--cdta-gold);
  background: #f8f9fc;
}

.widget-content { padding: 1.25rem; }

.widget ul { list-style: none; padding: 0; margin: 0; }
.widget ul li { padding: .4rem 0; border-bottom: 1px solid #f0f2f5; font-size: .9rem; }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--cdta-text); }
.widget ul li a:hover { color: var(--cdta-blue); }

/* ── Comments ──────────────────────────────────────────────────────────────── */
.comments-area {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--cdta-border);
}

.comments-title {
  font-size: 1.25rem;
  color: var(--cdta-blue);
  margin-bottom: 1.5rem;
  padding-bottom: .5rem;
  border-bottom: 3px solid var(--cdta-gold);
  display: inline-block;
}

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

.comment {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.comment-avatar img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}

.comment-body {
  flex: 1;
  background: var(--cdta-surface);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.comment-author { font-weight: 700; color: var(--cdta-navy); font-size: .9rem; }
.comment-date   { font-size: .78rem; color: var(--cdta-muted); margin-bottom: .5rem; }
.comment-text   { font-size: .9rem; }

/* ── Comment form ──────────────────────────────────────────────────────────── */
.comment-form label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--cdta-navy);
  margin-bottom: .35rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: .6rem .9rem;
  border: 1.5px solid var(--cdta-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9rem;
  background: var(--cdta-surface);
  color: var(--cdta-text);
  transition: border-color .18s, box-shadow .18s;
  margin-bottom: 1rem;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--cdta-blue);
  box-shadow: 0 0 0 3px rgba(0,48,135,.12);
}

.comment-form textarea { min-height: 130px; resize: vertical; }

.comment-form input[type="submit"] {
  background: var(--cdta-blue);
  color: #fff;
  border: none;
  padding: .6rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, box-shadow .18s;
}

.comment-form input[type="submit"]:hover {
  background: var(--cdta-navy);
  box-shadow: 0 4px 12px rgba(0,48,135,.3);
}

/* ── Site Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--cdta-navy);
  color: rgba(255,255,255,.55);
  padding: 3rem 0 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  align-items: start;
}

.footer-widgets {
  display: flex;
  flex-direction: row;
  gap: 2rem;
}

.footer-brand .brand-name { font-size: 1.1rem; color: #fff; font-weight: 700; margin-bottom: .25rem; }
.footer-brand .brand-sub  { font-size: .75rem; color: rgba(255,255,255,.5); letter-spacing: .06em; text-transform: uppercase; }
.footer-brand p { font-size: .875rem; margin-top: .75rem; color: rgba(255,255,255,.55); }

.footer-col .widget {
  margin-bottom: 1.25rem;
}

.footer-col .widget .widget-title {
  padding: 0;
  background: none;
  border: none;
  margin-bottom: .5rem;
}

.footer-col .widget-content {
  padding: 0;
}

.footer-col .widget ul li {
  border-bottom-color: rgba(255,255,255,.08);
}

.footer-col h2,
.footer-col h3,
.footer-col h4,
.footer-col .widget-title {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--cdta-gold);
  margin-bottom: .5rem;
}

.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: .4rem; }
.footer-col ul li a { font-size: .875rem; color: rgba(255,255,255,.6); transition: color .18s; }
.footer-col ul li a:hover { color: var(--cdta-gold); }

.footer-bottom {
  text-align: center;
  padding: 1rem 0;
  font-size: .78rem;
  color: rgba(255,255,255,.35);
}

.footer-bottom a { color: rgba(255,255,255,.5); }
.footer-bottom a:hover { color: var(--cdta-gold); }

/* ── 404 ───────────────────────────────────────────────────────────────────── */
.error-404 {
  text-align: center;
  padding: 5rem 1.5rem;
}

.error-404 .error-code {
  font-size: 7rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cdta-blue), var(--cdta-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: .5rem;
}

.error-404 h2 { font-size: 1.75rem; color: var(--cdta-navy); margin-bottom: 1rem; }
.error-404 p  { color: var(--cdta-muted); margin-bottom: 2rem; max-width: 480px; margin-inline: auto; }

/* ── Search form ───────────────────────────────────────────────────────────── */
.search-form {
  display: flex;
  gap: .5rem;
  max-width: 440px;
  margin: 1.5rem auto;
}

.search-form input[type="search"] {
  flex: 1;
  padding: .65rem 1rem;
  border: 1.5px solid var(--cdta-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9rem;
  background: var(--cdta-surface);
  color: var(--cdta-text);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

.search-form input:focus {
  border-color: var(--cdta-blue);
  box-shadow: 0 0 0 3px rgba(0,48,135,.1);
}

.search-form button {
  background: var(--cdta-blue);
  color: #fff;
  border: none;
  padding: .65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s;
}

.search-form button:hover { background: var(--cdta-navy); }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1150px) {
  .has-sidebar  { flex-direction: column; }
  .widget-area  { width: 100%; }
  .posts-grid   { grid-template-columns: 1fr; }
  .footer-grid  { grid-template-columns: 1fr; }

  .main-navigation { display: none; border-top: none; padding: 0; }
  .main-navigation.toggled { display: flex; }
  .menu-toggle { display: flex; }

  .main-navigation.toggled {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--cdta-navy);
    padding: .75rem;
    box-shadow: var(--shadow-md);
  }

  .main-navigation.toggled ul {
    flex-direction: column;
    width: 100%;
    gap: .25rem;
  }

  .main-navigation.toggled ul li { width: 100%; }
  .main-navigation.toggled ul li a { width: 100%; }

  .entry-header .entry-title { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  :root { --nav-h: 4rem; }
  .custom-logo-link img { height: 52px; }
  .site-content { padding: 1.5rem 0; }
  .brand-sub { display: none; }
}
