/*
Theme Name: UDFO Paris
Theme URI: https://www.udfo75.net/
Author: UD FO 75 / Maxsolu
Author URI: https://maxsolu.com/
Description: Thème de blocs indépendant pour l’Union Départementale Force Ouvrière de Paris.
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 7.4
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: udfo-paris
Tags: block-patterns, full-site-editing, accessibility-ready, custom-logo, news
*/

/* Local brand fonts keep layout measurements stable and avoid third-party requests. */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/montserrat-400.woff2") format("woff2");
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/montserrat-600.woff2") format("woff2");
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/montserrat-700.woff2") format("woff2");
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 800 900;
  font-display: swap;
  src: url("assets/fonts/montserrat-800.woff2") format("woff2");
}

@font-face {
  font-family: "Proza Libre";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/proza-libre-400.woff2") format("woff2");
}

@font-face {
  font-family: "Proza Libre";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/proza-libre-600.woff2") format("woff2");
}

@font-face {
  font-family: "Proza Libre";
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url("assets/fonts/proza-libre-700.woff2") format("woff2");
}

:root {
  --wp-admin-bar-offset: 0px;
}

.admin-bar {
  --wp-admin-bar-offset: 32px;
}

.site-header.is-scroll-animated {
  top: var(--wp-admin-bar-offset) !important;
}

.wp-site-blocks {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  overflow: clip;
  background: #fff;
  transition: transform .42s cubic-bezier(.22,1,.36,1);
}

.wp-site-blocks > * {
  margin-block-start: 0;
}

.wp-block-template-part {
  margin: 0;
}

.udfo-main {
  min-height: 62vh;
}

.alignwide,
.udfo-container {
  width: min(calc(100% - 48px), 1160px);
  margin-inline: auto;
}

.alignfull {
  width: 100%;
}

.screen-reader-text,
.udfo-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  z-index: 100000;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  padding: 12px 18px;
  clip: auto;
  background: #fff;
  color: #17191d;
  font-weight: 700;
}

/* WordPress server-rendered navigation adaptations. */
.desktop-nav .menu,
.drawer-nav .menu,
.footer-menu {
  padding: 0;
  margin: 0;
  list-style: none;
}

.desktop-nav .menu {
  display: flex;
  width: auto;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 3.2vw, 52px);
}

@media (max-width: 767px) {
  body.menu-open .wp-site-blocks {
    box-shadow: -20px 0 42px rgba(30, 0, 7, .2);
    transform: translateX(var(--drawer-width));
  }
}

.desktop-nav .menu-item {
  position: relative;
}

.desktop-nav .menu-item > a {
  position: relative;
  display: block;
  padding: 15px 0;
  font-family: "Proza Libre", Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.desktop-nav .menu-item > a::after {
  position: absolute;
  right: 50%;
  bottom: 6px;
  left: 50%;
  height: 2px;
  background: currentColor;
  content: "";
  transition: inset .25s ease;
}

.desktop-nav .menu-item:hover > a::after,
.desktop-nav .menu-item:focus-within > a::after,
.desktop-nav .current-menu-item > a::after,
.desktop-nav .current-menu-ancestor > a::after {
  right: 0;
  left: 0;
}

.desktop-nav .sub-menu {
  position: absolute;
  z-index: 5;
  top: 100%;
  left: 50%;
  min-width: 182px;
  padding: 8px;
  margin: 0;
  border-radius: 6px;
  background: #c9001e;
  box-shadow: 0 12px 24px rgba(77, 0, 12, .24);
  list-style: none;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .18s ease, transform .18s ease;
}

.desktop-nav .menu-item:hover > .sub-menu,
.desktop-nav .menu-item:focus-within > .sub-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.desktop-nav .sub-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 4px;
  font-family: "Proza Libre", Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.desktop-nav .menu-item-has-children > a::before,
.drawer-nav .menu-item-has-children > a::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 0 3px 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  float: right;
  transform: rotate(45deg);
}

.drawer-nav .menu > li > a,
.drawer-nav .sub-menu a {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  border-bottom: 1px solid rgba(255,255,255,.2);
  color: #fff;
  font-family: "Proza Libre", Helvetica, Arial, sans-serif;
  font-weight: 700;
}

.drawer-nav .sub-menu {
  padding: 0;
  margin: 0;
  list-style: none;
}

.drawer-nav .sub-menu a {
  min-height: 44px;
  padding-left: 44px;
  font-size: 14px;
}

.udfo-header-search {
  margin: 0;
}

/* Dynamic REST browser. Initial cards and pagination are server rendered. */
.udfo-browser-shell {
  position: relative;
}

.udfo-browser-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 34px;
  margin-bottom: 30px;
}

.udfo-browser-tools--search {
  grid-template-columns: minmax(0, 640px);
}

.article-search .udfo-year-filter {
  max-width: 96px;
  padding: 7px 9px;
  border: 0;
  border-right: 1px solid #e9e9ec;
  background: #fff;
  color: #46484e;
  font-size: 12px;
  outline: 0;
}

.udfo-browser-results[aria-busy="true"] {
  opacity: .55;
  pointer-events: none;
}

.udfo-browser-status {
  min-height: 24px;
  margin: 0 0 14px;
  color: #62646b;
  font-size: 14px;
}

.udfo-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.news-page-grid .udfo-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.udfo-browser-shell--compact .udfo-card-grid {
  grid-template-columns: 1fr;
  gap: 18px;
}

.udfo-browser-shell--compact .udfo-article-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
}

.udfo-browser-shell--compact .udfo-article-card > a:first-child,
.udfo-browser-shell--compact .udfo-article-card img,
.udfo-browser-shell--compact .udfo-card-placeholder {
  width: 190px;
  height: 100%;
  min-height: 170px;
}

.udfo-article-card {
  display: flex;
  min-height: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(25,27,31,.08);
  flex-direction: column;
}

.udfo-article-card > a:first-child {
  display: block;
  overflow: hidden;
}

.udfo-article-card img,
.udfo-card-placeholder {
  width: 100%;
  height: 195px;
  object-fit: cover;
  background: #f3f3f5;
}

.udfo-article-card-body {
  display: flex;
  padding: 23px;
  flex: 1;
  flex-direction: column;
}

.udfo-article-card h2,
.udfo-article-card h3 {
  margin: 7px 0 10px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
}

.udfo-article-card p {
  margin: 0 0 16px;
  color: #62646b;
  font-size: 14px;
}

.udfo-article-card .text-link {
  margin-top: auto;
}

.udfo-pagination,
.udfo-pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.udfo-pagination {
  margin-top: 38px;
}

.udfo-pagination .page-numbers {
  min-width: 42px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid #e9e9ec;
  border-radius: 5px;
  background: #fff;
  color: #17191d;
  font-weight: 700;
}

.udfo-pagination .current {
  border-color: #e60024;
  background: #e60024;
  color: #fff;
}

.udfo-empty,
.udfo-browser-error {
  padding: 28px;
  border-radius: 8px;
  background: #fff3f4;
  color: #4a4c52;
  text-align: center;
}

/* Single article: one sticky rail whose containing block spans heading + body. */
.article-share-scope {
  position: relative;
}

.article-share-rail {
  position: absolute;
  z-index: 6;
  top: 60px;
  left: max(24px, calc((100vw - 1160px) / 2 - 78px));
  height: calc(100% - 120px);
}

.article-share-rail .share-links {
  position: sticky;
  top: calc(var(--wp-admin-bar-offset) + 94px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.share-links a,
.share-links button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #e9e9ec;
  border-radius: 50%;
  background: #fff;
  color: #e60024;
  font: 700 13px/1 "Montserrat", Arial, sans-serif;
  cursor: pointer;
  place-items: center;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.share-links a:hover,
.share-links button:hover {
  background: #e60024;
  color: #fff;
  transform: translateY(-2px);
}

.article-page-head {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 42px 0 56px;
  background: #fff;
  color: #17191d;
}

.article-page-head > .wp-block-post-featured-image {
  position: absolute;
  z-index: -2;
  inset: 0;
  margin: 0;
  opacity: .2;
}

.article-page-head > .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-page-head::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, #fff 0%, rgba(255,255,255,.98) 46%, rgba(255,255,255,.76) 100%);
  content: "";
}

.article-page-head .wp-block-post-title {
  max-width: 900px;
  margin: 12px 0 18px;
  font-size: clamp(38px, 5.4vw, 68px);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.04;
}

.article-page-head .wp-block-post-excerpt {
  max-width: 760px;
  margin: 0;
  color: #46484e;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.65;
}

.article-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  color: #62646b;
  font-size: 13px;
}

.article-meta-line .wp-block-post-terms {
  color: #e60024;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.article-body-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) 300px;
  align-items: start;
  justify-content: space-between;
  gap: 64px;
  padding-top: 54px;
  padding-bottom: 70px;
}

.article-content,
.editor-styles-wrapper {
  font-size: 17px;
  line-height: 1.78;
}

.article-content > * {
  margin-top: 0;
  margin-bottom: 1.45em;
}

.article-content h2,
.editor-styles-wrapper h2 {
  margin-top: 1.7em;
  margin-bottom: .7em;
  font-size: clamp(27px, 3vw, 36px);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.2;
}

.article-content h3,
.editor-styles-wrapper h3 {
  margin-top: 1.6em;
  margin-bottom: .6em;
  font-size: 23px;
  font-weight: 800;
}

.article-content .wp-block-image img,
.article-content .wp-block-gallery,
.article-content .wp-block-embed,
.article-content .wp-block-table {
  border-radius: 8px;
}

.is-style-udfo-quote,
.article-content blockquote {
  padding: 26px 30px;
  border: 0;
  border-left: 5px solid #e60024;
  border-radius: 0 8px 8px 0;
  margin: 32px 0;
  background: #fff3f4;
  color: #25272c;
  font-size: 20px;
  font-weight: 600;
}

.is-style-udfo-checks,
.article-content ul.is-style-udfo-checks {
  padding: 0;
  list-style: none;
}

.is-style-udfo-checks li {
  position: relative;
  padding-left: 31px;
  margin-bottom: 10px;
}

.is-style-udfo-checks li::before {
  position: absolute;
  top: .18em;
  left: 0;
  display: grid;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e60024;
  color: #fff;
  content: "✓";
  font-size: 12px;
  font-weight: 800;
  place-items: center;
}

.article-post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 0;
  border-block: 1px solid #e9e9ec;
  margin-top: 44px;
  font-weight: 800;
}

.related-section {
  margin-top: 44px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.related-card {
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(25,27,31,.08);
}

.related-card img,
.related-card-placeholder {
  width: 100%;
  height: 135px;
  object-fit: cover;
  background: #f1f1f3;
}

.related-card-body {
  padding: 17px;
}

.related-card h3 {
  margin: 6px 0 12px;
  font-size: 15px;
  line-height: 1.4;
}

.article-share-mobile {
  display: none;
}

/* Contact and membership shortcodes inherit the theme card treatment. */
.udfo-form-card,
.udfo-adhesion-form {
  padding: clamp(24px, 4vw, 42px);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(25,27,31,.08);
}

.udfo-adhesion-grid,
.udfo-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.udfo-field,
.udfo-adhesion-form p {
  margin: 0 0 18px;
}

.udfo-field label,
.udfo-adhesion-form label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 700;
}

.udfo-field input,
.udfo-field select,
.udfo-field textarea,
.udfo-adhesion-form input:not([type="checkbox"]),
.udfo-adhesion-form select,
.udfo-adhesion-form textarea {
  width: 100%;
  min-height: 49px;
  padding: 11px 13px;
  border: 1px solid #dfe0e4;
  border-radius: 5px;
  background: #fff;
  color: #17191d;
  font: inherit;
}

.udfo-field textarea,
.udfo-adhesion-form textarea {
  min-height: 150px;
  resize: vertical;
}

.udfo-form-status:not(:empty),
.udfo-field-error:not(:empty) {
  display: block;
  margin-top: 6px;
  color: #b6001b;
  font-size: 13px;
}

.udfo-map-only iframe {
  display: block;
  width: 100%;
  min-height: 520px;
  border: 0;
  border-radius: 8px;
}

.event-list > [data-feed-results],
.resource-list > [data-feed-results] {
  display: grid;
  gap: 14px;
}

.udfo-static-hero-image {
  background: url("assets/images/hero-march.webp") center / cover no-repeat;
}

.filter-panel.udfo-archive-filter {
  grid-template-columns: minmax(190px, 1fr) minmax(160px, .5fr) auto;
  margin-bottom: 26px;
}

.event-list .filter-panel.udfo-archive-filter {
  grid-template-columns: minmax(190px, 320px) auto;
}

.udfo-section {
  padding-block: 58px;
}

.udfo-section--soft {
  background: linear-gradient(180deg, #fff 0%, #fff8f8 100%);
}

.udfo-card-icon,
.udfo-service-icon,
.join-symbol {
  margin: 0;
  color: #e60024;
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.service-card .udfo-service-icon {
  color: #e60024;
  font-size: 38px;
}

.join-banner .join-symbol {
  color: #fff;
  font-size: 48px;
}

.udfo-page-head {
  padding: 50px 0 42px;
  background: linear-gradient(180deg, #fff 0%, #fff8f8 100%);
}

.udfo-page-head .wp-block-query-title,
.udfo-page-head h1 {
  margin: 0 0 18px;
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.06;
}

.udfo-breadcrumbs {
  margin-bottom: 22px;
  color: #696b72;
  font-size: 12px;
}

.udfo-breadcrumbs a:hover {
  color: #e60024;
}

.wp-block-post-content > .alignwide {
  max-width: 1160px;
}

.wp-block-post-content > .alignfull {
  max-width: none;
}

@media (max-width: 1280px) {
  .article-share-rail {
    left: 14px;
  }
}

@media (max-width: 1024px) {
  .udfo-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-body-layout {
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 38px;
  }

  .article-share-rail {
    display: none;
  }

  .article-share-mobile {
    display: block;
    margin-top: 28px;
  }

  .article-share-mobile .share-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
}

@media (max-width: 782px) {
  .admin-bar {
    --wp-admin-bar-offset: 46px;
  }
}

@media (max-width: 767px) {
  .alignwide,
  .udfo-container {
    width: min(calc(100% - 32px), 1160px);
  }

  .udfo-browser-tools {
    display: flex;
    gap: 14px;
    flex-direction: column-reverse;
  }

  .filter-panel.udfo-archive-filter,
  .event-list .filter-panel.udfo-archive-filter {
    grid-template-columns: 1fr;
  }

  .udfo-card-grid {
    grid-template-columns: 1fr;
  }

  .news-page-grid .udfo-card-grid {
    grid-template-columns: 1fr;
  }

  .udfo-browser-shell--compact .udfo-article-card {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .udfo-browser-shell--compact .udfo-article-card > a:first-child,
  .udfo-browser-shell--compact .udfo-article-card img,
  .udfo-browser-shell--compact .udfo-card-placeholder {
    width: 118px;
    min-height: 148px;
  }

  .udfo-browser-shell--compact .udfo-article-card-body {
    padding: 15px;
  }

  .udfo-browser-shell--compact .udfo-article-card h2 {
    font-size: 15px;
  }

  .udfo-browser-shell--compact .udfo-article-card p {
    display: none;
  }

  .article-body-layout {
    display: block;
    padding-top: 36px;
    padding-bottom: 48px;
  }

  .article-page-head {
    padding: 28px 0 38px;
  }

  .article-page-head .wp-block-post-title {
    font-size: clamp(33px, 10vw, 46px);
  }

  .page-sidebar {
    margin-top: 42px;
  }

  .related-grid {
    display: flex;
    overflow-x: auto;
    padding: 0 16px 18px 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .related-card {
    min-width: min(82vw, 280px);
    scroll-snap-align: start;
  }

  .udfo-adhesion-grid,
  .udfo-form-grid {
    grid-template-columns: 1fr;
  }

  .udfo-map-only iframe {
    min-height: 360px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
