/* ═══════════════════════════════════════════════
   PBHOMES — Journal Editorial CSS v1
   PL Creative Studio
   Tipografía: Cormorant Garamond (títulos) / Montserrat (texto)
   Provisional hasta cargar Didot LP + Helvetica de marca
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300&family=Montserrat:wght@300;400;500&display=swap');

:root {
    --pbh-serif:    'Cormorant Garamond', Georgia, serif;
    --pbh-sans:     'Montserrat', system-ui, sans-serif;
    --pbh-black:    #000000;
    --pbh-warm:     rgba(0,0,0,0.035);
    --pbh-stone:    rgba(0,0,0,0.48);
    --pbh-border:   rgba(0,0,0,0.12);
    --pbh-border-s: rgba(0,0,0,0.24);
    --pbh-img-bg:   rgba(0,0,0,0.06);
    /* Amber de marca — usado en subrayado del filtro activo
       y en el borde de "Read the story", según el brand book.
       Imani Red disponible si algún día quieres acento fuerte. */
    --pbh-amber:    #D7B46A;
    --pbh-red:      #BD0302;
}

/* ── Wrap ── */
.pbh-blog-wrap {
    font-family: var(--pbh-sans);
    color: var(--pbh-black);
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px 80px;
    position: relative;
    z-index: 1;
}

/* ── Reset de subrayado (por si el theme aplica underline global) ──
   Las tarjetas completas son <a>, así que el subrayado se heredaba
   a títulos, extractos y fechas. Los subrayados intencionales del
   diseño usan border-bottom, no text-decoration, así que no se ven
   afectados por este reset. */
.pbh-blog-wrap a,
.pbh-blog-wrap a:link,
.pbh-blog-wrap a:visited,
.pbh-blog-wrap a:hover,
.pbh-blog-wrap a:focus,
.pbh-blog-wrap a:active,
.pbh-blog-wrap a *,
.pbh-blog-wrap a:hover * {
    text-decoration: none !important;
    text-decoration-line: none !important;
    text-underline-offset: unset !important;
}

/* ── Hero ── */
.pbh-hero {
    padding: 52px 0 36px;
    border-bottom: 0.5px solid var(--pbh-border);
    margin-bottom: 36px;
}
.pbh-label {
    display: block;
    font-family: var(--pbh-sans);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--pbh-stone);
    margin-bottom: 18px;
}
.pbh-hero-title {
    font-family: var(--pbh-serif) !important;
    font-size: clamp(2.2rem, 5vw, 3.6rem) !important;
    font-weight: 300 !important;
    line-height: 1.06 !important;
    letter-spacing: -0.025em !important;
    color: var(--pbh-black) !important;
    margin: 0 0 20px !important;
    max-width: 620px;
}
.pbh-hero-meta {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 12px;
    font-weight: 300;
    color: var(--pbh-stone);
    letter-spacing: 0.06em;
}
.pbh-hero-meta span + span::before {
    content: '—';
    margin-right: 24px;
    opacity: 0.35;
}

/* ── Filtro ── */
.pbh-filter {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 32px;
    border-bottom: 0.5px solid var(--pbh-border);
}
.pbh-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--pbh-sans);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--pbh-stone);
    text-decoration: none;
    padding: 11px 16px;
    border-bottom: 1.5px solid transparent;
    margin-bottom: -0.5px;
    transition: color 0.2s, border-color 0.2s;
}
.pbh-filter-btn:hover,
.pbh-filter-btn.is-active {
    color: var(--pbh-black);
    border-bottom-color: var(--pbh-amber);
}
.pbh-filter-count {
    font-family: var(--pbh-serif);
    font-size: 0.75rem;
    opacity: 0.4;
}

/* ── Featured ── */
.pbh-featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 0.5px solid var(--pbh-border);
    margin-bottom: 56px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.25s;
    min-height: 420px;
}
.pbh-featured:hover { opacity: 0.85; }

.pbh-featured-img {
    position: relative;
    overflow: hidden;
    background: var(--pbh-img-bg);
    align-self: stretch;
    min-height: 420px;
}
.pbh-featured-img img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    transition: transform 0.6s ease;
}
.pbh-featured:hover .pbh-featured-img img { transform: scale(1.03); }

.pbh-featured-content {
    padding: 2.8rem 2.2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-left: 0.5px solid var(--pbh-border);
}
.pbh-featured-title {
    font-family: var(--pbh-serif) !important;
    font-size: clamp(1.5rem, 2.6vw, 2.1rem) !important;
    font-weight: 300 !important;
    line-height: 1.18 !important;
    letter-spacing: -0.01em !important;
    color: var(--pbh-black) !important;
    margin: 0 0 18px !important;
}

/* ── Shared atoms ── */
.pbh-tag {
    display: inline-block;
    font-family: var(--pbh-sans);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--pbh-stone);
    border: 0.5px solid var(--pbh-border-s);
    padding: 5px 10px;
    margin-bottom: 16px;
}
.pbh-excerpt {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.75;
    color: var(--pbh-stone);
    margin: 0 0 28px;
}
.pbh-read-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--pbh-sans);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--pbh-black);
    text-decoration: none;
    border-bottom: 1px solid var(--pbh-amber);
    padding-bottom: 4px;
}
.pbh-date-stamp {
    font-family: var(--pbh-sans);
    font-size: 11px;
    font-weight: 300;
    color: var(--pbh-stone);
    letter-spacing: 0.04em;
    margin: 14px 0 0;
    opacity: 0.7;
}
.pbh-img-placeholder {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: var(--pbh-img-bg);
}

/* ── Divider ── */
.pbh-divider {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0 0 32px;
}
.pbh-divider-line {
    flex: 1;
    height: 0.5px;
    background: var(--pbh-border);
}
.pbh-divider-text {
    font-family: var(--pbh-sans);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--pbh-stone);
    white-space: nowrap;
}

/* ── Carrusel ── */
.pbh-carousel-section { position: relative; }

.pbh-carousel-outer {
    position: relative;
    display: flex;
    align-items: stretch;
}

.pbh-carousel-track {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border: 0.5px solid var(--pbh-border);
    flex: 1;
    min-width: 0;
    height: 460px;
    overflow: hidden;
}
.pbh-carousel-track::-webkit-scrollbar { display: none; }

/* ── Cards ── */
.pbh-card {
    flex: 0 0 280px;
    border-right: 0.5px solid var(--pbh-border);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    scroll-snap-align: start;
    background: #fff;
    height: 460px;
    overflow: hidden;
}
.pbh-card:last-child { border-right: none; }

.pbh-card-img {
    position: relative;
    overflow: hidden;
    background: var(--pbh-img-bg);
    height: 70%;
    flex-shrink: 0;
}
.pbh-card-img img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    transition: transform 0.5s ease;
}
.pbh-card:hover .pbh-card-img img { transform: scale(1.04); }

.pbh-card-body {
    height: 30%;
    padding: 1rem 1rem 1.2rem;
    border-top: 0.5px solid var(--pbh-border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: background 0.2s;
}
.pbh-card:hover .pbh-card-body { background: var(--pbh-warm); }

.pbh-card .pbh-tag {
    margin-bottom: 8px;
    font-size: 8px;
    letter-spacing: 0.15em;
}

.pbh-card-title {
    font-family: var(--pbh-serif) !important;
    font-size: 1.05rem !important;
    font-weight: 300 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.01em !important;
    color: var(--pbh-black) !important;
    margin: 0 !important;
}

/* ── Flechas ── */
.pbh-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    border: 0.5px solid var(--pbh-border-s);
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pbh-black);
    transition: background 0.2s, opacity 0.2s;
    flex-shrink: 0;
}
.pbh-arrow:hover { background: var(--pbh-warm); }
.pbh-arrow.is-hidden { opacity: 0; pointer-events: none; }
.pbh-arrow-prev { left: -18px; }
.pbh-arrow-next { right: -18px; }

/* ── Vacío ── */
.pbh-empty {
    text-align: center;
    padding: 80px 0;
    font-family: var(--pbh-serif);
    font-size: 1.05rem;
    font-weight: 300;
    color: var(--pbh-stone);
    font-style: italic;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .pbh-featured { grid-template-columns: 1fr; min-height: auto; }
    .pbh-featured-img { min-height: 280px; }
    .pbh-featured-content {
        border-left: none;
        border-top: 0.5px solid var(--pbh-border);
    }
    .pbh-carousel-track { height: 400px; }
    .pbh-card { flex: 0 0 240px; }
    .pbh-arrow-prev { left: -10px; }
    .pbh-arrow-next { right: -10px; }
}

@media (max-width: 600px) {
    .pbh-blog-wrap { padding: 0 16px 60px; }
    .pbh-hero { padding: 32px 0 24px; }
    .pbh-carousel-track { height: 360px; }
    .pbh-card { flex: 0 0 72vw; }
    .pbh-arrow { display: none; }
    .pbh-filter { flex-wrap: nowrap; overflow-x: auto; }
    .pbh-filter-btn { white-space: nowrap; }
}

/* ── Ajustes para Divi ──
   El módulo de Texto de Divi aplica estilos propios al contenido
   del shortcode. Estos resets mantienen el layout editorial intacto. */
.et_pb_text_inner .pbh-blog-wrap,
.et_pb_code_inner .pbh-blog-wrap {
    max-width: 1160px;
    margin: 0 auto;
}
.pbh-blog-wrap p { margin-bottom: 0; }
.pbh-blog-wrap h1,
.pbh-blog-wrap h2,
.pbh-blog-wrap h3 { padding-bottom: 0 !important; }
.pbh-blog-wrap img { border-radius: 0 !important; }

/* ═══════════════════════════════════════════════
   TABLAS EDITORIALES PARA POSTS
   ───────────────────────────────────────────────
   El CSS vive aquí (no en el contenido del post)
   porque WordPress filtra <style> y style="" al
   guardar. Desde aquí no lo puede tocar nadie.

   Uso en el post — solo HTML con clases:

   <div class="pbh-table-wrap">
     <table class="pbh-table"> ... </table>
   </div>

   Para resaltar una fila: <tr class="is-highlight">
   ═══════════════════════════════════════════════ */

.pbh-table-wrap {
    width: 100%;
    margin: 36px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pbh-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    font-family: var(--pbh-sans);
    font-size: 14px;
    line-height: 1.65;
    color: var(--pbh-black);
    background: #FFFFFF;
}

.pbh-table th {
    padding: 16px 18px !important;
    text-align: left;
    vertical-align: top;
    font-family: var(--pbh-sans) !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase;
    color: rgba(0,0,0,0.55) !important;
    background: rgba(0,0,0,0.025);
    border: none !important;
    border-bottom: 1px solid var(--pbh-amber) !important;
    white-space: nowrap;
    line-height: 1.4 !important;
}

.pbh-table td {
    padding: 18px !important;
    text-align: left;
    vertical-align: top;
    font-family: var(--pbh-sans) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.65 !important;
    color: rgba(0,0,0,0.72) !important;
    border: none !important;
    border-bottom: 0.5px solid rgba(0,0,0,0.1) !important;
}

/* Primera columna: ancla visual */
.pbh-table td:first-child {
    font-family: var(--pbh-serif) !important;
    font-size: 1.05rem !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    letter-spacing: -0.01em !important;
    color: var(--pbh-black) !important;
    white-space: nowrap;
}

.pbh-table tbody tr:last-child td {
    border-bottom: none !important;
}

.pbh-table tbody tr:hover td {
    background: rgba(0,0,0,0.018);
}

/* Fila destacada — <tr class="is-highlight"> */
.pbh-table tbody tr.is-highlight td {
    background: rgba(215,180,106,0.09);
}
.pbh-table tbody tr.is-highlight:hover td {
    background: rgba(215,180,106,0.13);
}
.pbh-table tbody tr.is-highlight td:first-child {
    box-shadow: inset 2px 0 0 var(--pbh-amber);
    color: var(--pbh-black) !important;
}

/* Divi mete padding y bordes propios a las tablas */
.pbh-table tr { background: transparent !important; }
.pbh-table caption { display: none; }

@media (max-width: 767px) {
    .pbh-table { min-width: 760px; font-size: 13px; }
    .pbh-table th { padding: 14px !important; }
    .pbh-table td { padding: 15px 14px !important; font-size: 13px !important; }
    .pbh-table td:first-child { font-size: 0.98rem !important; }
}

/* ═══════════════════════════════════════════════
   FAQ ACORDEÓN PARA POSTS
   ───────────────────────────────────────────────
   Usa <details>/<summary> nativos: cero JavaScript,
   accesible por teclado, y el contenido vive en el
   DOM aunque esté cerrado (Google lo indexa igual).

   Uso en el post:

   <div class="pbh-faq">
     <details class="pbh-faq-item">
       <summary class="pbh-faq-q">Pregunta</summary>
       <div class="pbh-faq-a"><p>Respuesta</p></div>
     </details>
   </div>

   Añade "open" al primer <details> si quieres que
   arranque abierto.
   ═══════════════════════════════════════════════ */

.pbh-faq {
    margin: 40px 0;
    border-top: 0.5px solid rgba(0,0,0,0.14);
}

.pbh-faq-item {
    border-bottom: 0.5px solid rgba(0,0,0,0.14);
    background: transparent;
}

/* ── Pregunta ── */
.pbh-faq-q {
    display: flex !important;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 0 !important;
    margin: 0 !important;
    cursor: pointer;
    list-style: none;
    font-family: var(--pbh-serif) !important;
    font-size: 1.18rem !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    letter-spacing: -0.01em !important;
    color: var(--pbh-black) !important;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.pbh-faq-q::-webkit-details-marker { display: none; }
.pbh-faq-q::marker { content: ''; }
.pbh-faq-q:hover { color: rgba(0,0,0,0.6) !important; }

/* ── Indicador + / − ── */
.pbh-faq-q::after {
    content: '';
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    margin-top: 7px;
    background-image:
        linear-gradient(var(--pbh-amber), var(--pbh-amber)),
        linear-gradient(var(--pbh-amber), var(--pbh-amber));
    background-size: 12px 1px, 1px 12px;
    background-position: center, center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease, background-size 0.3s ease;
}
.pbh-faq-item[open] > .pbh-faq-q::after {
    background-size: 12px 1px, 1px 0;
    transform: rotate(180deg);
}

/* ── Respuesta ──
   Los estilos van en el contenedor Y en los <p> porque el
   editor clásico a veces borra las etiquetas <p> al guardar.
   Así el texto se ve igual en ambos casos. */
.pbh-faq-a {
    padding: 0 42px 26px 0;
    animation: pbhFaqIn 0.28s ease;
    font-family: var(--pbh-sans) !important;
    font-size: 14.5px !important;
    font-weight: 400 !important;
    line-height: 1.75 !important;
    color: rgba(0,0,0,0.68) !important;
}
.pbh-faq-a p {
    font-family: var(--pbh-sans) !important;
    font-size: 14.5px !important;
    font-weight: 400 !important;
    line-height: 1.75 !important;
    color: rgba(0,0,0,0.68) !important;
    margin: 0 0 14px !important;
}
.pbh-faq-a p:last-child { margin-bottom: 0 !important; }

@keyframes pbhFaqIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .pbh-faq-q { font-size: 1.05rem !important; padding: 18px 0 !important; gap: 16px; }
    .pbh-faq-a { padding: 0 28px 22px 0; }
    .pbh-faq-a p { font-size: 14px !important; }
}
