/**
 * Layout Principal — Fortunna Lusitanos Theme
 *
 * Cobre a estrutura macro do site.
 * Depende de: variables.css → style.css → components.css
 *
 * @package FortunnaLusitanosTheme
 * @since   1.0.0
 */

/* ═══════════════════════════════════════════════════════════
   CONTENTOR GLOBAL
═══════════════════════════════════════════════════════════ */

.fl-wrap,
.wrap {
    width:          100%;
    max-width:      var(--fl-max-w);
    margin-inline:  auto;
    padding-inline: var(--fl-pad);
}

.fl-wrap--narrow  { max-width: var(--fl-max-w-narrow);  margin-inline: auto; padding-inline: var(--fl-pad); }
.fl-wrap--mid     { max-width: var(--fl-max-w-mid);     margin-inline: auto; padding-inline: var(--fl-pad); }
.fl-wrap--article { max-width: var(--fl-max-w-article); margin-inline: auto; padding-inline: var(--fl-pad); }
.fl-wrap--full    { max-width: none; padding-inline: 0; }

/* ═══════════════════════════════════════════════════════════
   ESTRUTURA DA PÁGINA
═══════════════════════════════════════════════════════════ */

.site-wrapper {
    display:        flex;
    flex-direction: column;
    min-height:     100svh;
}

.site-header { position: relative; z-index: var(--fl-z-nav); }

.site-main {
    flex:        1;
    padding-top: calc(var(--fl-nav-h) + var(--fl-admin-bar-h, 0px));
}

.has-hero-full .site-main { padding-top: 0; }

.site-footer { position: relative; z-index: var(--fl-z-base); }

/* ═══════════════════════════════════════════════════════════
   LAYOUT COM / SEM SIDEBAR
═══════════════════════════════════════════════════════════ */

.content-area { padding-block: var(--fl-gap-section); }

.has-sidebar .content-area .fl-wrap {
    display:               grid;
    grid-template-columns: 1fr 320px;
    gap:                   clamp(3rem, 5vw, 5rem);
    align-items:           start;
}

.primary-content { min-width: 0; }

.sidebar-area {
    position: sticky;
    top:      calc(var(--fl-nav-h) + var(--fl-admin-bar-h, 0px) + 2rem);
}


/* ═══════════════════════════════════════════════════════════
   SIDEBAR — Widgets
═══════════════════════════════════════════════════════════ */

/* Widget container */
.sidebar-area .widget {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--fl-linen);
}
.sidebar-area .widget:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Título do widget */
.sidebar-area .widget-title,
.sidebar-area .widgettitle {
    font-family:    var(--fl-font-heading);
    font-size:      11px;
    font-weight:    400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color:          var(--fl-noir-light);
    filter:         none;
    margin:         0 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom:  1px solid var(--fl-linen);
}

/* Listas genéricas de widgets */
.sidebar-area .widget ul {
    list-style: none;
    margin:     0;
    padding:    0;
    display:    flex;
    flex-direction: column;
    gap:        0.45rem;
}
.sidebar-area .widget ul li a {
    font-family:     var(--fl-font-body);
    font-size:       13px;
    font-weight:     300;
    color:           var(--fl-noir-light);
    text-decoration: none;
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    padding:         0.35rem 0;
    border-bottom:   1px solid transparent;
    transition:      color 0.3s, border-color 0.3s;
}
.sidebar-area .widget ul li a:hover {
    color:        var(--fl-champagne);
    filter:       brightness(0.82);
    border-color: var(--fl-linen);
}
/* Contagem de posts nas categorias/tags */
.sidebar-area .widget ul li .post-count,
.sidebar-area .widget_categories li .count,
.sidebar-area .widget_archive li .count {
    font-size:  10px;
    color:      var(--fl-stone);
    font-style: normal;
}

/* Widget de pesquisa */
.sidebar-area .widget_search .search-form {
    display:       flex;
    border-bottom: 1px solid var(--fl-linen);
    padding-bottom: 0.5rem;
    gap:           0.5rem;
}
.sidebar-area .widget_search .search-field {
    flex:        1;
    font-family: var(--fl-font-body);
    font-size:   13px;
    font-weight: 300;
    color:       var(--fl-noir);
    background:  transparent;
    border:      none;
    padding:     0.4rem 0;
}
.sidebar-area .widget_search .search-field:focus-visible { outline: 2px solid var(--fl-noir); outline-offset: 2px; }
.sidebar-area .widget_search .search-field::placeholder { color: var(--fl-stone); }
.sidebar-area .widget_search .search-submit {
    font-family:    var(--fl-font-heading);
    font-size:      11px;
    font-weight:    400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color:          var(--fl-noir-light);
    background:     transparent;
    border:         none;
    cursor:         pointer;
    padding:        0;
    transition:     color 0.3s;
}
.sidebar-area .widget_search .search-submit:hover { color: var(--fl-champagne); filter: brightness(0.82); }

/* Posts recentes */
.sidebar-area .widget_recent_entries ul li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--fl-linen);
}
.sidebar-area .widget_recent_entries ul li:first-child { padding-top: 0; }
.sidebar-area .widget_recent_entries ul li:last-child  { border-bottom: none; }
.sidebar-area .widget_recent_entries ul li a {
    font-size:   13px;
    font-weight: 300;
    line-height: 1.4;
    color:       var(--fl-noir);
    border:      none;
}
.sidebar-area .widget_recent_entries .post-date {
    display:     block;
    font-size:   10px;
    font-weight: 300;
    color:       var(--fl-stone);
    margin-top:  0.2rem;
    letter-spacing: 0.1em;
}

/* Nuvem de tags */
.sidebar-area .widget_tag_cloud .tagcloud {
    display:   flex;
    flex-wrap: wrap;
    gap:       0.4rem;
}
.sidebar-area .widget_tag_cloud .tagcloud a,
.sidebar-area .widget_tag_cloud .tag-cloud-link {
    font-family:     var(--fl-font-heading) !important;
    font-size:       11px !important;
    font-weight:     400;
    letter-spacing:  0.12em;
    text-transform:  uppercase;
    padding:         0.3rem 0.8rem;
    border:          1px solid var(--fl-champagne-border);
    color:           var(--fl-stone);
    text-decoration: none;
    transition:      all 0.25s;
    display:         inline-block;
}
.sidebar-area .widget_tag_cloud .tagcloud a:hover {
    border-color: var(--fl-champagne);
    color:        var(--fl-noir);
    filter:       none;
}

/* Calendário */
.sidebar-area .widget_calendar table {
    width:           100%;
    border-collapse: collapse;
    font-size:       12px;
}
.sidebar-area .widget_calendar th,
.sidebar-area .widget_calendar td {
    text-align: center;
    padding:    0.3rem;
    font-family: var(--fl-font-body);
    font-weight: 300;
    color:       var(--fl-stone);
}
.sidebar-area .widget_calendar .wp-calendar-nav {
    display:         flex;
    justify-content: space-between;
    font-size:       10px;
    margin-top:      0.5rem;
}

/* ═══════════════════════════════════════════════════════════
   ENTRY CONTENT — Gutenberg
═══════════════════════════════════════════════════════════ */

.entry-content { max-width: var(--fl-max-w-article); }
.entry-content > * + * { margin-top: 1.5rem; }

.entry-content h2 {
    font-family: var(--fl-font-heading); font-size: clamp(1.4rem,2.5vw,2rem);
    font-weight: 700; letter-spacing: var(--fl-tracking-heading);
    color: var(--fl-noir); line-height: var(--fl-leading-tight);
    margin-top: 2.75rem; margin-bottom: 1rem;
    padding-top: 2.25rem; border-top: var(--fl-border);
}
.entry-content h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.entry-content h3 {
    font-family: var(--fl-font-heading); font-size: clamp(1.1rem,1.8vw,1.4rem);
    font-weight: 600; letter-spacing: var(--fl-tracking-heading);
    color: var(--fl-noir); line-height: var(--fl-leading-snug);
    margin-top: 2.25rem; margin-bottom: 0.85rem;
}

.entry-content h4 {
    font-family: var(--fl-font-heading); font-size: clamp(1rem,1.4vw,1.15rem);
    font-weight: 600; letter-spacing: var(--fl-tracking-heading);
    color: var(--fl-noir); margin-top: 2rem; margin-bottom: 0.75rem;
}

.entry-content p {
    font-size: clamp(0.9375rem,1.1vw,1rem); font-weight: var(--fl-weight-light);
    line-height: var(--fl-leading-looser); color: var(--fl-noir-dim);
    margin-bottom: 1.35rem; max-width: none;
}

.entry-content p.has-drop-cap:first-of-type::first-letter,
.entry-content > p:first-of-type.lead::first-letter {
    font-family: var(--fl-font-heading); font-size: 4.2em; font-weight: 700;
    line-height: 0.72; float: left; margin-right: 0.08em; margin-top: 0.08em;
    color: var(--fl-champagne); filter: brightness(0.82);
}

.entry-content ul, .entry-content ol { padding-left: 1.5rem; margin-bottom: 1.35rem; }
.entry-content ul li, .entry-content ol li {
    font-size: clamp(0.9375rem,1.1vw,1rem); line-height: var(--fl-leading-relaxed);
    color: var(--fl-noir-muted); margin-bottom: 0.45rem;
}
.entry-content ul { list-style: none; padding-left: 1.25rem; }
.entry-content ul li { position: relative; padding-left: 0.5rem; }
.entry-content ul li::before { content: '·'; position: absolute; left: -1rem; color: var(--fl-champagne); font-weight: 700; }
.entry-content ol { list-style: decimal; padding-left: 1.5rem; }

.entry-content blockquote, .wp-block-quote {
    border-left: 3px solid var(--fl-champagne); margin: 2.5rem 0;
    padding: 1.75rem 2rem; background: var(--fl-champagne-bg);
}
.entry-content blockquote p, .wp-block-quote p {
    font-style: italic; font-weight: var(--fl-weight-thin);
    font-size: clamp(1.05rem,1.7vw,1.25rem); line-height: var(--fl-leading-relaxed);
    color: var(--fl-noir); margin: 0;
}
.entry-content blockquote cite, .wp-block-quote cite {
    display: block; font-family: var(--fl-font-heading); font-size: 11px;
    font-weight: 400; font-style: normal; letter-spacing: 0.18em;
    text-transform: uppercase; color: var(--fl-noir-light); margin-top: 0.75rem;
}

.entry-content hr, .wp-block-separator {
    border: none; border-top: var(--fl-border); margin: 3rem 0; position: relative;
}
.entry-content hr::after {
    content: '◆'; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%,-50%); font-size: 10px;
    background: var(--fl-white); padding: 0 0.5rem; color: var(--fl-champagne-border);
}

.entry-content img, .entry-content figure img {
    filter: var(--fl-img-filter); transition: filter var(--fl-dur-slow) var(--fl-ease);
    max-width: 100%; height: auto;
}
.entry-content img:hover { filter: var(--fl-img-filter-hover); }

.entry-content figcaption, .wp-block-image figcaption {
    font-family: var(--fl-font-body); font-style: italic; font-size: var(--fl-text-sm);
    font-weight: var(--fl-weight-light); color: var(--fl-stone);
    text-align: center; margin-top: 0.6rem;
}

.entry-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: var(--fl-text-sm); }
.entry-content th {
    background: var(--fl-champagne-bg); color: var(--fl-noir);
    font-family: var(--fl-font-heading); font-size: 11px;
    letter-spacing: 0.16em; text-transform: uppercase;
    padding: 0.75rem 1rem; border: var(--fl-border);
}
.entry-content td { padding: 0.65rem 1rem; border: var(--fl-border); color: var(--fl-noir-muted); line-height: var(--fl-leading-relaxed); }
.entry-content tr:hover td { background: var(--fl-champagne-bg); }

/* ═══════════════════════════════════════════════════════════
   PAGE HERO TIPOGRÁFICO
═══════════════════════════════════════════════════════════ */

.page-hero-text {
    background: var(--fl-noir);
    padding: calc(var(--fl-nav-h) + var(--fl-admin-bar-h, 0px) + clamp(3rem,6vh,5rem)) 0 clamp(2.5rem,4vh,4rem);
    position: relative; overflow: hidden;
}
/* Hero com imagem de fundo: o gradiente noir já vem inline do PHP.
   Este modificador permite ajustes adicionais quando há imagem. */
.page-hero-text.has-bg-image .page-hero-text__title { color: var(--fl-white); }
.page-hero-text.has-bg-image .page-hero-text__lead  { color: rgba(253,252,250,.65); }

.page-hero-text[data-letter]::after {
    content: attr(data-letter); position: absolute;
    font-family: var(--fl-font-heading); font-size: clamp(18rem,38vw,34rem);
    font-weight: 700; color: rgba(216,202,175,.03); line-height: 1;
    top: -0.05em; right: -0.02em; pointer-events: none; user-select: none;
}
/* Breadcrumb no hero da ficha do cavalo */
.page-hero-text__breadcrumb {
    display:     flex;
    flex-wrap:   wrap;
    align-items: center;
    gap:         .35rem;
    margin-bottom: 1rem;
}
.page-hero-text__breadcrumb a,
.page-hero-text__breadcrumb span {
    font-family:    var(--fl-font-heading);
    font-size:      11px;
    font-weight:    400;
    letter-spacing: .14em;
    text-transform: uppercase;
    color:          rgba(216,202,175,.80);
    text-decoration: none;
    transition:     color .25s;
}
.page-hero-text__breadcrumb a:hover { color: var(--fl-champagne); }
.page-hero-text__breadcrumb-sep {
    color:          rgba(216,202,175,.45);
    font-size:      11px;
}

.page-hero-text__eyebrow {
    font-family: var(--fl-font-heading); font-size: var(--fl-eyebrow-size);
    font-weight: 400; letter-spacing: var(--fl-tracking-label);
    text-transform: uppercase; color: rgba(216,202,175,.65);
}
.page-hero-text__title {
    font-family: var(--fl-font-heading); font-size: clamp(2.2rem,5.5vw,5rem);
    font-weight: 700; color: var(--fl-white); line-height: var(--fl-leading-tightest);
    letter-spacing: var(--fl-tracking-heading); margin-top: 0.85rem;
}
.page-hero-text__lead {
    font-family: var(--fl-font-body); font-style: italic;
    font-size: clamp(0.9rem,1.5vw,1.1rem); font-weight: var(--fl-weight-thin);
    color: rgba(253,252,250,.5); margin-top: 1.1rem; max-width: 580px;
    line-height: var(--fl-leading-relaxed);
}
.page-hero-text__rule {
    display: block; width: 40px; height: 1px;
    background: var(--fl-champagne); opacity: .5; margin-top: 2rem;
}

/* ═══════════════════════════════════════════════════════════
   GRIDS PRINCIPAIS
═══════════════════════════════════════════════════════════ */

.posts-grid   { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--fl-gap-md); }
.horses-grid  { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--fl-gap-md); }
.gallery-strip{ display: grid; grid-template-columns: repeat(5,1fr); gap: var(--fl-gallery-gap); }

.horses-grid--asymmetric { grid-template-columns: 1.1fr 1fr 1fr; grid-template-rows: auto auto; }
.horses-grid--asymmetric .hcard--tall { grid-row: 1 / 3; }

/* ═══════════════════════════════════════════════════════════
   LAYOUT ARTIGO INDIVIDUAL
═══════════════════════════════════════════════════════════ */

.article-layout { padding-block: var(--fl-gap-section); background: var(--fl-white); }
.article-layout__inner {
    display: grid;
    grid-template-columns: var(--fl-max-w-article) 1fr;
    gap: clamp(4rem,6vw,7rem); align-items: start;
    max-width: calc(var(--fl-max-w-article) + 380px + clamp(4rem,6vw,7rem) + (var(--fl-pad) * 2));
    margin-inline: auto; padding-inline: var(--fl-pad);
}
.article-sidebar {
    position: sticky; top: calc(var(--fl-nav-h) + 2rem);
    display: flex; flex-direction: column; gap: 1.75rem;
}

/* ═══════════════════════════════════════════════════════════
   LAYOUT FICHA DO CAVALO
═══════════════════════════════════════════════════════════ */

.horse-content { padding-block: var(--fl-gap-section); background: var(--fl-white); }
.horse-content__inner { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(3.5rem,6vw,7rem); align-items: start; }
.horse-sidebar { position: sticky; top: calc(var(--fl-nav-h) + 2rem); display: flex; flex-direction: column; gap: 0; }

/* Botões da caixa lateral (1.5.13): o texto parte em várias linhas em vez de
   esticar a caixa para fora do ecrã (os .btn são white-space:nowrap). */
.horse-sidebar > *  { min-width: 0; }
.horse-sidebar .btn {
    white-space: normal;
    text-align:  center;
    line-height: 1.35;
    min-height:  48px;          /* alvo de toque confortável */
    max-width:   100%;
}

/* ═══════════════════════════════════════════════════════════
   SECÇÕES REUTILIZÁVEIS
═══════════════════════════════════════════════════════════ */

/* About */
.about-section { padding-block: var(--fl-gap-section); background: var(--fl-white); }
.about-section__inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(4rem,8vw,9rem); align-items: center; }

/* Story blocks alternados */
.story-section { padding-block: var(--fl-gap-section); background: var(--fl-off-white); }
.story-block { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(3.5rem,7vw,8rem); align-items: center; margin-bottom: clamp(5rem,9vw,8rem); }
.story-block:last-child { margin-bottom: 0; }
.story-block--reverse { direction: rtl; }
.story-block--reverse > * { direction: ltr; }

/* Serviços */
.svc-section { padding-block: var(--fl-gap-section); scroll-margin-top: calc(var(--fl-nav-h) + 52px); }
.svc-section:nth-child(odd)  { background: var(--fl-white); }
.svc-section:nth-child(even) { background: var(--fl-off-white); }
.svc-section__inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(4rem,8vw,9rem); align-items: center; }
.svc-section--reverse .svc-section__inner { direction: rtl; }
.svc-section--reverse .svc-section__inner > * { direction: ltr; }

/* Numbers band */
.numbers-band { background: var(--fl-noir); padding-block: clamp(3.5rem,6vw,5rem); }
.numbers-band__inner { display: grid; grid-template-columns: repeat(4,1fr); gap: 0; }

/* Values */
.values-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: rgba(253,252,250,.06); border: 1px solid rgba(253,252,250,.06); }

/* Services grid */
.services-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--fl-gap-md); }

/* Locations */
.locations-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--fl-gap-md); }

/* Awards */
.awards-grid { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(3rem,6vw,6rem); align-items: center; }
.awards-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Contact split */
.contact-section { padding-block: var(--fl-gap-section); background: var(--fl-linen); }
.contact-section__inner { display: grid; grid-template-columns: 1fr 1px 1fr; gap: clamp(3rem,6vw,7rem); align-items: center; }
.contact-divider { background: var(--fl-champagne-border); height: 100%; min-height: 200px; }

/* FAQ */
.faq-section { padding-block: var(--fl-gap-section); background: var(--fl-white); }
.faq-section__inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(3rem,6vw,6rem); align-items: start; }
.faq-aside { position: sticky; top: calc(var(--fl-nav-h) + 56px + 2rem); }

/* Newsletter */
.newsletter-band { background: var(--fl-noir); padding-block: clamp(4rem,8vw,7rem); position: relative; overflow: hidden; }
.newsletter-band::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 60% 80% at 50% 50%,rgba(216,202,175,.04) 0%,transparent 70%); pointer-events: none; }
.newsletter-band__inner { position: relative; z-index: 1; max-width: 640px; margin-inline: auto; text-align: center; }

/* CTA band */
.cta-band { background: var(--fl-noir); padding-block: clamp(3.5rem,7vw,6rem); position: relative; overflow: hidden; }
.cta-band::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 60% 80% at 75% 50%,rgba(216,202,175,.06) 0%,transparent 70%); pointer-events: none; }
.cta-band__inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto; gap: 3rem; align-items: center; }

/* Manifesto */
.manifesto { padding-block: clamp(6rem,12vw,11rem); background: var(--fl-noir); position: relative; overflow: hidden; }
.manifesto::after { content: 'F'; position: absolute; font-family: var(--fl-font-heading); font-size: clamp(18rem,38vw,34rem); font-weight: 700; color: rgba(216,202,175,.03); line-height: 1; top: -0.05em; left: -0.02em; pointer-events: none; user-select: none; }
.manifesto__inner { position: relative; z-index: 1; max-width: 880px; margin-inline: auto; text-align: center; }

/* Hero split */
.hero-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 100svh; }
.hero-split__panel { background: var(--fl-noir); display: flex; flex-direction: column; justify-content: space-between; padding: calc(var(--fl-nav-h) + clamp(3rem,6vh,5rem)) clamp(2rem,5vw,5.5rem) clamp(3rem,6vh,5rem); position: relative; overflow: hidden; }
.hero-split__panel::before { content: 'F'; position: absolute; font-family: var(--fl-font-heading); font-size: clamp(16rem,32vw,28rem); font-weight: 700; color: rgba(216,202,175,.03); line-height: 1; bottom: -0.1em; left: -0.04em; pointer-events: none; user-select: none; }
.hero-split__panel::after { content: ''; position: absolute; top: 10%; bottom: 10%; right: 0; width: 1px; background: linear-gradient(to bottom,transparent,var(--fl-champagne-border) 30%,var(--fl-champagne-border) 70%,transparent); }
.hero-split__photo { position: relative; overflow: hidden; min-height: 100svh; }
.hero-split__photo img { filter: var(--fl-img-filter-hero); object-position: center 30%; height: 100%; width: 100%; object-fit: cover; }

/* Timeline */
.timeline-section { padding-block: var(--fl-gap-section); background: var(--fl-champagne-bg); }
.timeline-section__hd { text-align: center; margin-bottom: clamp(3.5rem,7vw,6rem); }
.timeline { position: relative; display: flex; flex-direction: column; gap: 0; }
.timeline::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: linear-gradient(to bottom,transparent,var(--fl-champagne-border) 10%,var(--fl-champagne-border) 90%,transparent); transform: translateX(-50%); }
.tl-item { display: grid; grid-template-columns: 1fr 40px 1fr; align-items: flex-start; gap: 0; padding-bottom: clamp(2.5rem,5vw,4rem); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item__content-left  { padding-right: 2.5rem; text-align: right; }
.tl-item__content-right { padding-left:  2.5rem; text-align: left; }
.tl-item__node { display: flex; align-items: flex-start; justify-content: center; padding-top: 0.2rem; flex-shrink: 0; }

/* 404 */
.page-404 { position: relative; background: var(--fl-noir); min-height: 100svh; display: flex; flex-direction: column; overflow: hidden; }
.page-404__bg { position: absolute; inset: 0; z-index: 0; }
.page-404__bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; filter: grayscale(55%) brightness(.28) sepia(14%); }
.page-404__veil { position: absolute; inset: 0; background: radial-gradient(ellipse 80% 70% at 50% 50%,rgba(20,18,16,.45) 0%,rgba(20,18,16,.92) 100%); z-index: 1; }
.page-404__watermark { position: fixed; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; pointer-events: none; user-select: none; overflow: hidden; }
.page-404__num { font-family: var(--fl-font-heading); font-size: clamp(18rem,45vw,38rem); font-weight: 700; color: rgba(216,202,175,.04); line-height: 1; letter-spacing: var(--fl-tracking-heading); }
.page-404__content { position: relative; z-index: 10; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem var(--fl-pad); }

/* Pesquisa */
.search-results-header { padding: calc(var(--fl-nav-h) + 3rem) 0 2.5rem; background: var(--fl-noir); }
.search-results-title { font-family: var(--fl-font-heading); font-size: clamp(1.8rem,4vw,3.5rem); font-weight: 700; color: var(--fl-white); letter-spacing: var(--fl-tracking-heading); }
.search-form-wrap { margin-top: 1.5rem; max-width: 540px; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */

/* Barra de contacto da ficha no telemóvel (1.5.13) — ver single-cavalos.php */
.fl-horse-bar { display: none; }
@media (max-width: 768px) {
    .fl-horse-bar {
        display:    block;
        position:   fixed;
        left: 0; right: 0; bottom: 0;
        z-index:    390;
        background: var(--fl-noir);
        border-top: 1px solid rgba(216,202,175,.18);
        padding:    .65rem var(--fl-pad, 1rem) calc(.65rem + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -6px 24px rgba(0,0,0,.25);
        transform:  translateY(110%);
        visibility: hidden;
        transition: transform .35s var(--fl-ease, ease), visibility 0s linear .35s;
    }
    .fl-horse-bar.is-visible {
        transform:  translateY(0);
        visibility: visible;
        transition: transform .35s var(--fl-ease, ease), visibility 0s;
    }
    .fl-horse-bar__inner { display: flex; gap: .6rem; }
    .fl-horse-bar .btn {
        min-height:      48px;
        justify-content: center;
        padding-inline:  .9rem;
        letter-spacing:  .1em;
        white-space:     normal;
        text-align:      center;
        line-height:     1.25;
    }
    .fl-horse-bar__main { flex: 1 1 auto; }
    .fl-horse-bar__wa   { flex: 0 0 auto; }
    /* "Voltar ao topo" sobe para não ficar por cima da barra */
    body.has-horse-bar .fl-scroll-top { bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; }
}
@media (prefers-reduced-motion: reduce) {
    .fl-horse-bar, .fl-horse-bar.is-visible { transition: none; }
}

@media (max-width: 1100px) {
    .has-sidebar .content-area .fl-wrap { grid-template-columns: 1fr; }
    .sidebar-area { position: static; }
    .article-layout__inner { grid-template-columns: 1fr; max-width: var(--fl-max-w-article); padding-inline: var(--fl-pad); }
    .article-sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
    .horse-content__inner { grid-template-columns: minmax(0, 1fr); }
    .horse-sidebar { position: static; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
    .about-section__inner, .svc-section__inner, .story-block { grid-template-columns: 1fr; gap: 2.5rem; }
    .svc-section--reverse .svc-section__inner, .story-block--reverse { direction: ltr; }
    .hero-split { grid-template-columns: 1fr; min-height: auto; }
    .hero-split__panel::after { display: none; }
    .hero-split__photo { min-height: 55vh; }
    .numbers-band__inner { grid-template-columns: repeat(2,1fr); }
    .posts-grid, .horses-grid, .values-grid { grid-template-columns: repeat(2,1fr); }
    .horses-grid--asymmetric { grid-template-columns: 1fr 1fr; }
    .horses-grid--asymmetric .hcard--tall { grid-row: 1; }
    .gallery-strip { grid-template-columns: repeat(3,1fr); }
    .contact-section__inner { grid-template-columns: 1fr; gap: 3rem; }
    .contact-divider { display: none; }
    .awards-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .awards-list { grid-template-columns: 1fr 1fr; }
    .faq-section__inner { grid-template-columns: 1fr; }
    .faq-aside { position: static; }
    .cta-band__inner { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    /* Barra de filtros — scroll horizontal em mobile */
    .cat-nav .fl-wrap {
        flex-wrap:     nowrap;
        overflow-x:    auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;         /* Firefox */
        padding-block: 0;
    }
    .cat-nav .fl-wrap::-webkit-scrollbar { display: none; }  /* Chrome/Safari */

    .posts-grid, .horses-grid, .locations-grid { grid-template-columns: 1fr; }
    .services-grid, .values-grid { grid-template-columns: repeat(2,1fr); }
    .gallery-strip { grid-template-columns: repeat(2,1fr); }
    .timeline::before { left: 14px; transform: none; }
    .tl-item { grid-template-columns: 28px 1fr; }
    .tl-item:nth-child(odd) .tl-item__content-left  { grid-column: 2; grid-row: 1; text-align: left; padding-right: 0; padding-left: 0; }
    .tl-item:nth-child(odd) .tl-item__content-right { display: none; }
    .tl-item:nth-child(even) .tl-item__content-right { grid-column: 2; grid-row: 1; text-align: left; padding-left: 0; padding-right: 0; }
    .tl-item:nth-child(even) .tl-item__content-left  { display: none; }
    .tl-item__node { grid-column: 1; grid-row: 1; justify-content: flex-start; padding-top: 0.35rem; }
    .article-sidebar, .horse-sidebar { grid-template-columns: minmax(0, 1fr); }

    /* Botões da ficha no telemóvel: menos espaçamento entre letras e nas
       margens, para caberem numa linha sempre que possível (1.5.13). */
    .horse-sidebar .btn {
        padding-inline: 1.25rem;
        letter-spacing: .12em;
        font-size:      12px;
    }
}

@media (max-width: 560px) {
    :root { --fl-nav-h: var(--fl-nav-h-mobile); }
    .services-grid, .values-grid, .awards-list { grid-template-columns: 1fr; }
    .gallery-strip { grid-template-columns: repeat(2,1fr); }
    .numbers-band__inner { grid-template-columns: 1fr 1fr; }
    .cta-band__inner { gap: 2rem; }
}

/* ═══════════════════════════════════════════════════════════
   GALERIA DE FOTOS DO CAVALO
═══════════════════════════════════════════════════════════ */

.gallery-grid {
    display:               grid;
    grid-template-columns: repeat(3, 1fr);
    gap:                   var(--fl-gallery-gap, 4px);
}

@media (max-width: 560px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

.gthumb {
    display:    block;
    padding:    0;
    border:     none;
    background: var(--fl-noir);
    cursor:     zoom-in;
    overflow:   hidden;
}

.gthumb img {
    display:      block;
    width:        100%;
    height:       auto;
    aspect-ratio: 1;
    object-fit:   cover;
    transition:   transform .5s var(--fl-ease), filter .4s;
    filter:       var(--fl-img-filter-card);
}

.gthumb:hover img {
    transform: scale(1.04);
    filter:    brightness(1.05);
}

/* ═══════════════════════════════════════════════════════════
   PEDIGREE — ÁRVORE GENEALÓGICA
═══════════════════════════════════════════════════════════ */

.pedigree {
    /* Sem overflow:hidden no container — permite scroll se necessário */
}

.pedigree-tree {
    display:     grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap:         1.5rem;
    align-items: stretch;
}

.ped-col {
    display:        flex;
    flex-direction: column;
    gap:            .75rem;
    justify-content: flex-start;  /* era center — evita espaço vazio quando há só 1 nó */
}

.ped-node {
    padding:    .85rem 1rem;
    border:     var(--fl-border);
    background: var(--fl-white);
    flex:       1;
}

/* Sujeito: nunca estica — tem apenas 1 nó na coluna */
.ped-col--subject .ped-node {
    flex: 0 0 auto;
}

.ped-node--sire { border-left: 3px solid var(--fl-champagne); }
.ped-node--dam  { border-left: 3px solid var(--fl-stone); }
.ped-node--subject {
    border-left: 3px solid var(--fl-noir);
    background:  var(--fl-champagne-bg);
}

.ped-node__label {
    font-family:    var(--fl-font-heading);
    font-size:      10px;  /* era 7px — ilegível em mobile */
    font-weight:    400;
    letter-spacing: .16em;
    text-transform: uppercase;
    color:          var(--fl-stone);
    margin-bottom:  .3rem;
}

.ped-node__name {
    font-family:    var(--fl-font-heading);
    font-size:      .9rem;
    font-weight:    600;
    color:          var(--fl-noir);
    line-height:    1.2;
}

.ped-node__detail {
    font-family:    var(--fl-font-body);
    font-size:      12px;
    font-weight:    300;
    color:          var(--fl-stone);
    margin-top:     .25rem;
}

/* ── Eyebrow em fundo branco (horse-content, pedigree, aptidões, partilhar) ──
   A classe base .fl-eyebrow usa --fl-champagne pensada para fundos escuros.
   No corpo da ficha do cavalo (fundo branco) precisa de maior contraste. */
.horse-content .fl-eyebrow,
.horse-main    .fl-eyebrow {
    color:  var(--fl-noir-light);  /* #443D35 — contraste ~7:1 sobre branco */
    filter: none;
}

/* Mobile: 2 colunas — sujeito + pais. Avós empilham abaixo dos pais. */
@media (max-width: 640px) {
    .pedigree-tree {
        grid-template-columns: 1fr 1fr;
        gap:                   1rem;
    }
    /* Coluna dos avós salta para baixo dos pais, largura total */
    .ped-col:last-child {
        grid-column: 1 / -1;
        display:     grid;
        grid-template-columns: 1fr 1fr;
        gap:         .75rem;
    }
}

.ped-legend {
    display:    flex;
    gap:        1.5rem;
    margin-top: 1rem;
    flex-wrap:  wrap;
}

.ped-legend__item {
    display:     flex;
    align-items: center;
    gap:         .4rem;
    font-family: var(--fl-font-body);
    font-size:   11px;
    font-weight: 300;
    color:       var(--fl-stone);
}

.ped-legend__dot {
    display:       inline-block;
    width:         10px;
    height:        10px;
    border-radius: 50%;
    flex-shrink:   0;
}

.ped-legend__dot--sire { background: var(--fl-champagne); }
.ped-legend__dot--dam  { background: var(--fl-stone); }

/* ═══════════════════════════════════════════════════════════
   BOTÕES DE PARTILHA SOCIAL
═══════════════════════════════════════════════════════════ */

.share-btns {
    display:   flex;
    flex-wrap: wrap;
    gap:       .5rem;
}

.share-btn {
    display:         inline-flex;
    align-items:     center;
    gap:             .45rem;
    font-family:     var(--fl-font-heading);
    font-size:       11px;
    font-weight:     400;
    letter-spacing:  .12em;
    text-transform:  uppercase;
    color:           var(--fl-noir-light);
    text-decoration: none;
    padding:         .45rem .9rem;
    border:          var(--fl-border);
    background:      transparent;
    cursor:          pointer;
    transition:      background .25s, color .25s, border-color .25s;
    white-space:     nowrap;
}

.share-btn svg {
    width:      14px;
    height:     14px;
    flex-shrink: 0;
}

.share-btn:hover {
    background:   var(--fl-champagne-bg);
    color:        var(--fl-noir);
    border-color: var(--fl-champagne-border);
}

.share-btn.copied {
    background: var(--fl-champagne-bg);
    color:      var(--fl-noir);
}


/* ── Linhagem → Stud-Book APSL (ficha do cavalo, v1.5.0) ─────────────────
   Substitui a árvore genealógica visual por um botão para o registo APSL. */
.fl-apsl {
    margin-bottom: clamp(2.5rem, 4vw, 4rem);
    padding: clamp(1.25rem, 3vw, 2rem);
    background: var(--fl-champagne-bg);
    border: var(--fl-border);
}
.fl-apsl__eyebrow { margin-bottom: 1rem; }
.fl-apsl__parents {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .5rem 1rem;
    margin: 0 0 1.5rem;
    font-family: var(--fl-font-heading);
    font-size: clamp(.95rem, 1.6vw, 1.15rem);
    font-weight: 600;
    letter-spacing: .03em;
    color: var(--fl-noir);
}
.fl-apsl__parent-label {
    display: block;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--fl-stone);
    margin-bottom: .25rem;
}
.fl-apsl__parent { display: inline-flex; flex-direction: column; }
.fl-apsl__sep { color: var(--fl-champagne); filter: brightness(.82); line-height: 1.5; }
.fl-apsl__btn { display: inline-flex; max-width: 100%; white-space: normal; text-align: center; } /* quebra linha em ecrãs estreitos */
.fl-apsl__btn svg { width: 14px; height: 14px; }
.fl-apsl__note {
    margin: 1rem 0 0;
    font-family: var(--fl-font-body);
    font-size: 12.5px;
    font-weight: 300;
    line-height: 1.6;
    color: rgba(20, 18, 16, .6);
}
.fl-apsl__note strong { font-weight: 500; color: var(--fl-noir); }
.fl-apsl__feedback:empty { display: none; }
.fl-apsl__feedback {
    margin: .6rem 0 0;
    font-family: var(--fl-font-body);
    font-size: 12px;
    color: var(--fl-noir);
}

/* ── Comentários (comments.php, 1.5.3) ─────────────────────────────────── */
.fl-comments { margin-top: clamp(3rem, 6vw, 5rem); padding-top: clamp(2rem, 4vw, 3rem); border-top: var(--fl-border); }
.fl-comments__title { font-family: var(--fl-font-heading); font-size: clamp(1.1rem, 1.8vw, 1.4rem); font-weight: 600; letter-spacing: .04em; color: var(--fl-noir); margin-bottom: 1.5rem; }
.fl-comments__list, .fl-comments__list .children { list-style: none; margin: 0; padding: 0; }
.fl-comments__list .children { margin-left: clamp(1rem, 4vw, 2.5rem); }
.fl-comments__list .comment-body { padding: 1.25rem 0; border-bottom: 1px solid var(--fl-linen); }
.fl-comments__list .comment-author { display: flex; align-items: center; gap: .75rem; font-weight: 500; }
.fl-comments__list .comment-author .avatar { border-radius: 50%; }
.fl-comments__list .comment-metadata, .fl-comments__list .comment-metadata a { font-size: 12px; color: var(--fl-stone); text-decoration: none; }
.fl-comments__list .reply a { font-family: var(--fl-font-heading); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.fl-comments__closed { color: var(--fl-stone); font-size: 14px; }
.fl-comments__respond { margin-top: 2rem; }
.fl-comments__respond .comment-form { display: flex; flex-direction: column; gap: 1.25rem; }
.fl-comments__respond .comment-notes, .fl-comments__respond .logged-in-as { font-size: 13px; color: var(--fl-stone); }


/* ── Blocos do WordPress (vídeo, título, texto, imagem…) em páginas de blocos ──
   O <article class="page-blocks-content"> é de largura total, para os blocos
   da Fortunna (que têm o seu próprio .flb-wrap) irem de ponta a ponta. Os
   blocos do núcleo do WordPress postos directamente nele não tinham
   contentor: ficavam colados aos limites do ecrã e o ".alignwide" ainda os
   empurrava para fora (margem negativa), criando scroll horizontal.
   Aqui recebem a mesma margem lateral e largura máxima dos outros blocos. */

/* "Largo" e "Largura total" já não saem do ecrã */
.page-blocks-content > .alignwide,
.page-blocks-content > .alignfull {
    margin-left:  0;
    margin-right: 0;
}

/* Margem lateral = a do .fl-wrap / .flb-wrap (centrada até --fl-max-w) */
.page-blocks-content > :where(:not([class*="wp-block-fortunnalusitanos-"]):not(.alignfull)) {
    box-sizing:     border-box;
    width:          100%;
    max-width:      none;
    margin-inline:  0;
    padding-inline: max(var(--fl-pad), calc((100% - var(--fl-max-w)) / 2 + var(--fl-pad)));
}

/* Espaço acima e abaixo de vídeos e imagens, como nas secções */
.page-blocks-content > .wp-block-embed,
.page-blocks-content > .wp-block-video,
.page-blocks-content > .wp-block-image {
    padding-block: clamp(2.5rem, 5vw, 4.5rem);
}

/* Vídeo e imagem "largura total" (alignfull) ficam de ponta a ponta, sem margem */
.page-blocks-content > .wp-block-embed.alignfull,
.page-blocks-content > .wp-block-video.alignfull,
.page-blocks-content > .wp-block-image.alignfull {
    padding-inline: 0;
    padding-block:  0;
}
