/* =========================================================
   Abbé Pivert – Styles de la page d’accueil personnalisée
   Strictement cloisonnés au modèle template-home-custom.php
   ========================================================= */

/* Variables */
:root {
  --ap-parchment: #fefaf1;
  --ap-sand: #f6eedf;
  --ap-earth: #291e16;
  --ap-madder: #6d1819;
  --ap-midnight: #111e33;
  --ap-gold: #c2985c;
  --ap-border: rgba(41, 30, 22, 0.14);
  --ap-muted: rgba(41, 30, 22, 0.65);
  --ap-radius: 0.5rem;
  --ap-max-width: 72rem;
  --ap-font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ap-font-serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
}

/* Reset minimal pour le document autonome */
.ap-home *,
.ap-home *::before,
.ap-home *::after {
  box-sizing: border-box;
}

.ap-home html {
  -webkit-text-size-adjust: 100%;
  line-height: 1.5;
}

.ap-home body {
  margin: 0;
  font-family: var(--ap-font-sans);
  background-color: var(--ap-parchment);
  color: var(--ap-earth);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.ap-home a {
  color: inherit;
  text-decoration: none;
}

.ap-home img {
  max-width: 100%;
  height: auto;
  display: block;
}

.ap-home ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ap-home h1,
.ap-home h2,
.ap-home h3,
.ap-home p {
  margin: 0;
}

.ap-home .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Layout */
.ap-home .ap-wrapper {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.ap-home .ap-container {
  width: 100%;
  max-width: var(--ap-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .ap-home .ap-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Header */
.ap-home .ap-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--ap-border);
  background-color: rgba(254, 250, 241, 0.9);
  backdrop-filter: blur(8px);
}

@supports not (backdrop-filter: blur(8px)) {
  .ap-home .ap-header {
    background-color: var(--ap-parchment);
  }
}

.ap-home .ap-header-inner {
  display: flex;
  height: 4rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .ap-home .ap-header-inner {
    height: 5rem;
  }
}

.ap-home .ap-brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ap-home .ap-brand-name {
  font-family: var(--ap-font-serif);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ap-madder);
}

@media (min-width: 640px) {
  .ap-home .ap-brand-name {
    font-size: 1.25rem;
  }
}

.ap-home .ap-brand-tagline {
  display: none;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ap-muted);
}

@media (min-width: 640px) {
  .ap-home .ap-brand-tagline {
    display: inline;
  }
}

.ap-home .ap-header-nav {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.ap-home .ap-header-link {
  font-size: 1rem;
  color: rgba(41, 30, 22, 0.8);
  transition: color 0.15s ease;
}

.ap-home .ap-header-link:hover {
  color: var(--ap-madder);
}

.ap-home .ap-search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--ap-earth);
  cursor: pointer;
  border-radius: var(--ap-radius);
}

.ap-home .ap-search-form {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ap-home .ap-search-input {
  width: 0;
  opacity: 0;
  height: 2.25rem;
  padding: 0 0.5rem;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  background-color: var(--ap-parchment);
  font-size: 0.875rem;
  color: var(--ap-earth);
  outline: none;
  transition: width 0.2s ease, opacity 0.2s ease;
}

.ap-home .ap-search-input:focus {
  width: 10rem;
  opacity: 1;
  border-color: var(--ap-madder);
}

.ap-home .ap-search-form:focus-within .ap-search-input {
  width: 10rem;
  opacity: 1;
}

/* Hero */
.ap-home .ap-hero {
  overflow: hidden;
  border-bottom: 1px solid var(--ap-border);
  background-color: rgba(246, 238, 223, 0.3);
}

.ap-home .ap-hero-inner {
  display: flex;
  max-width: var(--ap-max-width);
  flex-direction: column;
  align-items: flex-end;
  gap: 2rem;
  padding: 1rem 1rem 0;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .ap-home .ap-hero-inner {
    padding: 1.5rem 1.5rem 0;
  }
}

@media (min-width: 768px) {
  .ap-home .ap-hero-inner {
    flex-direction: row;
  }
}

@media (min-width: 1024px) {
  .ap-home .ap-hero-inner {
    padding-top: 2rem;
  }
}

.ap-home .ap-hero-image-wrap {
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .ap-home .ap-hero-image-wrap {
    width: 40%;
  }
}

@media (min-width: 1024px) {
  .ap-home .ap-hero-image-wrap {
    width: 33.3333%;
  }
}

.ap-home .ap-hero-image {
  width: 100%;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.12));
}

.ap-home .ap-hero-content {
  flex: 1;
  align-self: flex-start;
}

@media (min-width: 768px) {
  .ap-home .ap-hero-content {
    margin-top: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .ap-home .ap-hero-content {
    margin-top: 2.5rem;
  }
}

.ap-home .ap-hero-title {
  max-width: 48rem;
  font-family: var(--ap-font-serif);
  font-size: 1.875rem;
  line-height: 1.25;
  color: var(--ap-madder);
}

@media (min-width: 640px) {
  .ap-home .ap-hero-title {
    font-size: 2.25rem;
    line-height: 1.15;
  }
}

@media (min-width: 1024px) {
  .ap-home .ap-hero-title {
    font-size: 3rem;
  }
}

.ap-home .ap-hero-subtitle {
  max-width: 42rem;
  margin-top: 1rem;
  font-size: 1.125rem;
  line-height: 1.625;
  color: rgba(41, 30, 22, 0.8);
}

@media (min-width: 640px) {
  .ap-home .ap-hero-subtitle {
    font-size: 1.125rem;
  }
}

.ap-home .ap-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 3.5rem;
}

.ap-home .ap-hero-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ap-home .ap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: var(--ap-radius);
  font-size: 1.0625rem;
  font-weight: 500;
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  border: 1px solid transparent;
}

.ap-home .ap-btn-primary {
  background-color: var(--ap-madder);
  color: var(--ap-parchment);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.ap-home .ap-btn-primary:hover {
  background-color: rgba(109, 24, 25, 0.9);
}

/* Main content */
.ap-home .ap-main {
  flex: 1;
}

.ap-home .ap-content {
  max-width: var(--ap-max-width);
  margin: 0 auto;
  padding: 3.5rem 1rem;
}

@media (min-width: 640px) {
  .ap-home .ap-content {
    padding: 5rem 1.5rem;
  }
}

.ap-home .ap-section + .ap-section {
  margin-top: 4rem;
}

/* Quick access grid */
.ap-home .ap-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .ap-home .ap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .ap-home .ap-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ap-home .ap-card {
  display: flex;
  height: 100%;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--ap-border);
  border-radius: 0.25rem;
  background-color: var(--ap-parchment);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ap-home .ap-card:hover {
  border-color: rgba(109, 24, 25, 0.4);
  background-color: rgba(246, 238, 223, 0.4);
}

.ap-home .ap-card-icon {
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  background-color: var(--ap-sand);
  color: var(--ap-madder);
}

.ap-home .ap-card-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.ap-home .ap-card-body {
  min-width: 0;
}

.ap-home .ap-card-title {
  display: block;
  font-family: var(--ap-font-serif);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ap-earth);
}

.ap-home .ap-card:hover .ap-card-title {
  color: var(--ap-madder);
}

.ap-home .ap-card-desc {
  display: block;
  margin-top: 0.125rem;
  font-size: 1rem;
  color: var(--ap-muted);
}

/* Newsletter */
.ap-home .ap-newsletter {
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  background-color: var(--ap-parchment);
  padding: 1.5rem;
}

@media (min-width: 640px) {
  .ap-home .ap-newsletter {
    padding: 2rem;
  }
}

.ap-home .ap-newsletter-title {
  font-family: var(--ap-font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ap-madder);
}

.ap-home .ap-newsletter-text {
  margin-top: 0.5rem;
  font-size: 1.0625rem;
  color: var(--ap-muted);
}

.ap-home .ap-newsletter-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .ap-home .ap-newsletter-form {
    grid-template-columns: 1fr 1fr auto;
    align-items: flex-end;
  }
}

.ap-home .ap-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ap-home .ap-field label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ap-earth);
}

.ap-home .ap-input {
  height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  background-color: var(--ap-parchment);
  font-size: 1.0625rem;
  color: var(--ap-earth);
  outline: none;
}

.ap-home .ap-input:focus {
  border-color: var(--ap-madder);
}

/* Footer */
.ap-home .ap-footer {
  margin-top: 6rem;
  background-color: var(--ap-midnight);
  color: var(--ap-parchment);
}

.ap-home .ap-footer a {
  color: rgba(254, 250, 241, 0.8);
  transition: color 0.15s ease;
}

.ap-home .ap-footer a:hover {
  color: var(--ap-parchment);
}

.ap-home .ap-footer-main {
  display: grid;
  gap: 2.5rem;
  padding: 3.5rem 1rem;
}

@media (min-width: 640px) {
  .ap-home .ap-footer-main {
    padding: 3.5rem 1.5rem;
  }
}

@media (min-width: 768px) {
  .ap-home .ap-footer-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .ap-home .ap-footer-main {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.ap-home .ap-footer-heading {
  font-family: var(--ap-font-serif);
  font-size: 1.125rem;
  font-weight: 700;
}

.ap-home .ap-footer-text {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.625;
  color: rgba(254, 250, 241, 0.75);
}

.ap-home .ap-footer-list {
  margin-top: 0.75rem;
}

.ap-home .ap-footer-list li + li {
  margin-top: 0.5rem;
}

.ap-home .ap-footer-list a {
  font-size: 0.875rem;
}

.ap-home .ap-footer-bottom {
  border-top: 1px solid rgba(254, 250, 241, 0.15);
  padding: 1.5rem 1rem;
}

@media (min-width: 640px) {
  .ap-home .ap-footer-bottom {
    padding: 1.5rem 1.5rem;
  }
}

.ap-home .ap-footer-bottom-inner {
  display: flex;
  max-width: var(--ap-max-width);
  margin: 0 auto;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: rgba(254, 250, 241, 0.7);
}

@media (min-width: 640px) {
  .ap-home .ap-footer-bottom-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.ap-home .ap-footer-legal {
  display: flex;
  gap: 1rem;
}

/* Tuile « Et en outre… » */
.ap-home .ap-card-static {
  cursor: default;
}
.ap-home .ap-card-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.375rem;
  font-size: 1.0625rem;
}
.ap-home .ap-card-links a {
  color: var(--ap-madder);
  text-decoration: underline;
}
.ap-home .ap-card-links a:hover {
  color: var(--ap-earth);
}

/* Bloc de soutien */
.ap-home .ap-support {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-top: 2.5rem;
  padding: 1.5rem;
  border-left: 2px solid var(--ap-madder);
  border-radius: var(--ap-radius);
  background-color: rgba(246, 238, 223, 0.55);
}
@media (min-width: 640px) {
  .ap-home .ap-support {
    flex-direction: row;
    align-items: center;
    padding: 1.75rem;
  }
}
.ap-home .ap-support-title {
  margin: 0;
  font-family: var(--ap-font-serif);
  font-size: 1.375rem;
  color: var(--ap-earth);
}
.ap-home .ap-support-desc {
  margin: 0.375rem 0 0;
  font-size: 1.0625rem;
  color: var(--ap-muted);
  max-width: 42rem;
}
.ap-home .ap-btn-outline {
  flex-shrink: 0;
  border: 1px solid rgba(109, 24, 25, 0.4);
  color: var(--ap-madder);
  background-color: transparent;
}
.ap-home .ap-btn-outline:hover {
  background-color: var(--ap-madder);
  color: var(--ap-parchment);
}
.ap-home .ap-hidden-frame {
  display: none !important;
  width: 0;
  height: 0;
  border: 0;
}

/* Sécurités : ces éléments doivent rester visibles et lisibles */
.ap-home .ap-card-links a {
  text-decoration: underline;
  font-weight: 500;
}
.ap-home .ap-btn-outline {
  display: inline-flex !important;
  border-width: 2px;
  font-weight: 600;
}
