/**
 * Global styles — Sector 134
 * Most styling is handled by theme.json.
 * This file is for layout utilities and component resets only.
 */

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

body {
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    font-family: var(--wp--preset--font-family--body-font);
}

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

/* ─── Accessibility ──────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ─── Content width (matches theme.json) ── */
.content-width {
    max-width: var(--wp--style--global--content-size, 1200px);
    margin-inline: auto;
    padding-inline: var(--wp--preset--spacing--70, 40px);
}

/* header */
.site-header {
    padding: clamp(20px, 12px + 2.5vw, 60px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.eaaf-logo {
    display: flex;
    gap: clamp(10px, 8.286px + 0.536vw, 16px);
    font-size: clamp(13px, 10.429px + 0.804vw, 22px);
    text-transform: uppercase;
    line-height: 1;
    letter-spacing: -.02em;
    font-weight: 600;
    color: var(--wp--preset--color--black);
    align-items: center;
}
.eaaf-logo::before {
    content: '';
    background-image: url(../img/eaaf-logo.svg);
    height: clamp(30px, 24.286px + 1.786vw, 50px);
    width: clamp(56px, 44.857px + 3.482vw, 95px);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.eaaf-logo span {
    display: block;
}

/* ─── Hamburger button ───────────────────── */
.hamburger {
    position: fixed;
    top: clamp(24px, 15.2px + 2.75vw, 68px);
    right: clamp(20px, 12px + 2.5vw, 60px);
    z-index: 10001;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
}

.hamburger:hover {
}

.hamburger__line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--wp--preset--color--black);
    transition: transform 0.3s, opacity 0.3s;
}

/* Open state */
.hamburger--open .hamburger__line:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

.hamburger--open .hamburger__line:nth-child(2) {
    opacity: 0;
}

.hamburger--open .hamburger__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.site-header__right {
    display: flex;
    gap: clamp(24px, -3.429px + 3.571vw, 48px);
    align-items: center;
    padding-right: 46px;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    height: 40px;
    width: 24px;
}

.search-form {
    position: absolute;
    right: 0;
    top: 0;
    background-color: var(--wp--preset--color--white);
}

.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 110; /* Por encima del input */
    position: absolute;
    right: 8px;
    top: 8px;
}

.search-toggle svg {
    width: 24px;
    height: 24px;
    display: block;
}

.search-box-hidden {
    position: absolute;
    right: -5px; /* Alineado con la lupa */
    display: flex;
    align-items: center;
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s;
    background: var(--wp--preset--color--white);
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-box-visible {
    width: 280px; /* Ancho máximo al estirarse */
    opacity: 1;
    padding: 0 40px 0 0; /* 40px a la derecha para no tapar la lupa */
    border: 1px solid #ddd;
}

.search-field {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Saira Condensed', sans-serif;
    font-size: 16px;
    padding: 6px 12px;
    display: block;
}

/* Ocultar la cruz en Chrome, Safari y Edge */
.search-field::-webkit-search-cancel-button,
.search-field::-webkit-search-decoration,
.search-field::-webkit-search-results-button,
.search-field::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
}

/* Ocultar la cruz en Internet Explorer / Edge antiguo */
.search-field::-ms-clear,
.search-field::-ms-reveal {
    display: none;
    width: 0;
    height: 0;
}

.desktop-menu {
    display: none;
}

@media (min-width: 768px) {
    .desktop-menu {
        display: block;
    }
    .desktop-menu > ul {
        display: flex;
        gap: 16px;
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .desktop-menu li {
        position: relative;
        font-size: 18px;
        font-weight: 500;
        line-height: 1.2;
    }

    .dropdown-trigger {
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        text-transform: uppercase;
    }

    /* La flecha usando SVG */
    .dropdown-trigger::after {
        content: "";
        width: 16px;
        height: 16px;
        background-color: currentColor;
        mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" /></svg>') no-repeat center;
        transition: transform 0.3s ease;
    }

    /* Estado Abierto */
    .desktop-menu li:hover .dropdown-trigger::after {
        mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M9.47 6.47a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 1 1-1.06 1.06L10 8.06l-3.72 3.72a.75.75 0 0 1-1.06-1.06l4.25-4.25Z" clip-rule="evenodd" /></svg>') no-repeat center;
    }

    /* Ocultar dropdown por defecto */
    .desktop-menu ul ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 220px;
        background: var(--wp--preset--color--white);
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
        z-index: 100;
        padding: 1rem;
        list-style: none;
    }

    .desktop-menu ul ul li {
        margin-bottom: 8px;
    }

    /* Mostrar al hover */
    .desktop-menu li:hover > ul {
        display: block;
    }

    .desktop-menu ul ul a {
        color: var(--wp--preset--color--black);
        transition: color ease .3s;
        display: block;
    }

    .desktop-menu ul ul#menu-sector-134 a:hover {
        color: var(--wp--preset--color--lilac-dark);
    }
    .desktop-menu ul ul#menu-investigacion-forense a:hover {
        color: var(--wp--preset--color--green-dark);
    }
}

/* ─── Full-screen overlay menu ───────────── */
.overlay-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--wp--preset--color--background, #fff);
    z-index: 10000;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.overlay-menu--open {
    transform: translateX(0);
}

.overlay-menu__inner {
    padding: clamp(20px, 12px + 2.5vw, 60px);
}

.overlay-menu__logo {
    margin-bottom: 40px;
}

.main-menu__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-menu__list li {
    border-top: 1px solid var(--wp--preset--color--border, #ddd);
    display: block;
    line-height: 1;
    padding-bottom: 12px;
}

.main-menu__list li:last-child {
    border-bottom: 1px solid var(--wp--preset--color--border, #ddd);
}

.main-menu__list a {
    display: block;
    padding: 24px 0 12px 0;
    font-size: clamp(17px, 13.857px + 0.982vw, 28px);
    font-weight: 700;
    color: var(--wp--preset--color--black);
    text-decoration: none;
    transition: color 0.2s;
    text-transform: uppercase;
}

/* Sub-menu */
.main-menu__list .sub-menu {
    list-style: none;
    padding: 0 0 0 20px;
    margin: 0;
}

.main-menu__list .sub-menu li {
    border-top: none;
    border-bottom: none;
    padding: 0;
}

.main-menu__list .sub-menu a {
    font-weight: 400;
    padding: 8px 0;
    font-size: clamp(17px, 13.857px + 0.982vw, 28px);
    color: var(--wp--preset--color--black);
    text-transform: none;
    transition: color ease .3s;
}

.main-menu__list .sub-menu li.sector-134 a:hover {
    color: var(--wp--preset--color--lilac-dark);
}
.main-menu__list .sub-menu li.investigacion-forense a:hover {
    color: var(--wp--preset--color--green-dark);
}

/* Lock body scroll when menu open */
body.menu-open {
    overflow: hidden;
}

/* home hero */
.site-intro {
    display: grid;
    grid-template-columns: 1fr;
    margin-bottom: clamp(20px, 12px + 2.5vw, 60px);
}

@media(min-width:768px) {
    .site-intro {
        grid-template-columns: 1.18fr 1fr;
        align-items: center;
    }
}

.site-intro::before {
    content: '';
    background-image: url(../img/eaaf-avellaneda-sector-132.jpg);
    background-position: left;
    background-size: contain;
    background-repeat: no-repeat;
    display: block;
    height: 65vw ;
    mix-blend-mode: multiply;
}
@media(min-width:768px) {
    .site-intro::before {
        height: 45vw ;
    }
}

.site-intro-text {
    padding: 0 clamp(20px, 12px + 2.5vw, 60px);
}
@media(min-width:768px) {
    .site-intro-text {
        padding: 0 clamp(20px, 12px + 2.5vw, 60px) 0 0;
    }
}
.site-intro-text .site-title {
    font-size: clamp(26px, 18px + 2.5vw, 54px);
    text-transform: uppercase;
    font-weight: 400;
    line-height: 1;
    font-family: var(--wp--preset--font-family--body-font);
    color: var(--wp--preset--color--lilac-dark);
}
.site-intro-text .site-title em {
    font-style: normal;
    font-weight: 700;
    display: block;
}
.site-intro-text .site-description {
    font-size: clamp(18px, 16px + 0.625vw, 25px);
    line-height: 1.3;
}
@media(min-width:1440px) {
    .site-intro-text .site-title {
        font-size: clamp(54px, 0px + 3.75vw, 72px);
    }
    .site-intro-text .site-description {
        font-size: clamp(25px, -2px + 1.875vw, 34px);
    }
}
.site-footer {
    padding: clamp(60px, 42.857px + 5.357vw, 120px) clamp(20px, 14.286px + 1.786vw, 40px) clamp(20px, 14.286px + 1.786vw, 40px);
    background-color: #8c82b0;
    margin-top: clamp(-80px, -28.571px + -3.571vw, -40px);
    color: var(--wp--preset--color--white);
}
.category-la-investigacion-forense .site-footer {
    background-color: #85947d;
}
@media(min-width:1440px) {
    .site-footer {
        padding: clamp(120px, 6px + 7.917vw, 158px) clamp(20px, 12px + 2.5vw, 60px) clamp(20px, 12px + 2.5vw, 60px);
        margin-top: clamp(-98px, 6px + -5.417vw, -72px);
    }
}
.site-footer__copy {
    margin: 20px 0 0 0;
    font-size: clamp(14px, 12.571px + 0.446vw, 19px);
    max-width: 750px;
    line-height: 1.2;
}

.site-footer__inner .eaaf-logo {
    color: var(--wp--preset--color--white);
}
.site-footer__inner .eaaf-logo::before {
    background-image: url(../img/eaaf-logo-white.svg);
}
@media (min-width:768px){
    .site-footer__inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 20px;
    }
    .site-footer__inner .eaaf-logo {
        flex-shrink: 0;
    }
    .site-footer__copy {
        margin: 0;
    }
    .site-footer__copy span {
        display: block;
    }
}

@media(min-width:768px) {
    .site-footer-left {
        display: flex;
        gap: clamp(16px, 12.8px + 1vw, 32px);
    }
}

@media(max-width:767px) {
   .site-footer-left {
        margin-bottom: 24px;
   }
}



/* related posts */
.related-posts {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(16px, 11.429px + 1.429vw, 32px);
    padding: 0 clamp(20px, 12px + 2.5vw, 60px);
    margin-top: clamp(20px, 12px + 2.5vw, 60px);
}
@media(min-width:768px) {
    .related-posts {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.single .related-posts, .trim-point-container .related-posts {
    padding: 0;
}

.post-card {
  background-color: var(--wp--preset--color--white);
  padding: clamp(16px, 12px + 1.25vw, 30px) clamp(16px, 12px + 1.25vw, 30px) clamp(32px, 25.143px + 2.143vw, 56px);
  box-sizing: border-box; 
  /* esquina cortada */
  clip-path: polygon(0 0, calc(100% - 40px) 0, 100% 40px, 100% 100%, 0 100%);
  position: relative;
  transition: transform 0.3s ease;
}
@media(min-width:1440px) {
    .post-card {
        padding:clamp(30px, 0px + 2.083vw, 40px) clamp(30px, 0px + 2.083vw, 40px) clamp(56px, -10px + 4.583vw, 78px);
    }
}

.post-card:hover {
    transform: translateY(-5px); /* Se eleva un poquito */
}

.post-card.sector-134 {
    background-color: var(--wp--preset--color--lilac-light);
}

.post-card-title {
  font-size: clamp(24px, 21.143px + 0.893vw, 34px);
  font-weight: 700;
  line-height: 1;
  margin: 0 0 clamp(16px, 14.857px + 0.357vw, 20px);
  color: var(--wp--preset--color--black);
}
@media(min-width:1440px) {
    .post-card-title {
        margin: 0 0 clamp(20px, -22px + 2.917vw, 34px);
        font-size: clamp(34px, 1px + 2.292vw, 45px);
    }
}

.post-card-text {
  font-size: clamp(21px, 19.857px + 0.357vw, 25px);
  line-height: 1.2;
  margin: 0;
  position: relative;
}
@media(min-width:1440px) {
    .post-card-text {
        font-size: clamp(25px, 1px + 1.667vw, 33px);
    }
}

.post-card-text p {
    margin: 0;
}

.plus-icon {
  font-weight: 500;
  font-size: clamp(36px, 30.286px + 1.786vw, 56px);
  margin-left: 5px;
  color: var(--wp--preset--color--white);
    line-height: .05;
    position: relative;
    top: 0.1em;
}

.post-card-link {
    color: inherit;
}

.post-card-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.category-sector-134 .plus-icon {
    color: var(--wp--preset--color--lilac-dark);
}
.category-la-investigacion-forense .plus-icon {
    color: var(--wp--preset--color--green-dark);
}
.category-la-investigacion-forense .post-card-title {
    color: var(--wp--preset--color--green-dark);
}
.category-sector-134 .post-card-title {
    color: var(--wp--preset--color--lilac-dark);
}

/* SINGLE */
.single .site-main,
.page .site-main {
    padding-top: clamp(20px, 12px + 2.5vw, 60px);
}
.single .hentry, 
.trim-point-container  {
    margin-right: clamp(20px, 12px + 2.5vw, 60px);
    padding: clamp(20px, 12px + 2.5vw, 60px) clamp(20px, 12px + 2.5vw, 60px) clamp(60px, 42.857px + 5.357vw, 120px);
    /* esquina cortada */
    clip-path: polygon(0 0, calc(100% - 40px) 0, 100% 40px, 100% 100%, 0 100%);
    background-color: var(--wp--preset--color--white);
}
@media(min-width:1440px) {
    .single .hentry, 
    .trim-point-container,
    .page .hentry {
        padding: clamp(72px, -6px + 5.417vw, 98px) clamp(72px, -6px + 5.417vw, 98px) clamp(144px, -12px + 10.833vw, 196px);
        margin-right: clamp(72px, -6px + 5.417vw, 98px);
        max-width: 90vw;
    }
}

.trim-point-container { 
    background-color: #ededed;
}

.single .hentry.category-sector-134 {
    background-color: var(--wp--preset--color--lilac-light);
}
.single .hentry.category-la-investigacion-forense {
    background-color: var(--wp--preset--color--green-light);
}

.single .entry-header .entry-title, 
.trim-point-container .archive-title,
.trim-point-container .error-404__title,
.page .entry-header .entry-title {
    margin: 0 0 clamp(20px, 12px + 2.5vw, 60px) 0;
    font-size: clamp(32px, 26.571px + 1.696vw, 51px);
    text-transform: uppercase;
    font-weight: 700;
}

.single .entry-content p,
.trim-point-container p, 
.trim-point-container a,
.page .entry-content p {
    max-width: clamp(1130px, 20px + 77.083vw, 1500px);
    line-height: 1.3;
    font-size: clamp(18px, 15.143px + 0.893vw, 28px);
}

@media(min-width:1440px) {
    .single .entry-header .entry-title, 
    .trim-point-container .archive-title,
    .trim-point-container .error-404__title,
    .page .entry-header .entry-title {
        font-size: clamp(51px, 0px + 3.542vw, 68px);
    }
    .single .entry-content p,
    .trim-point-container p, 
    .trim-point-container a,
    .page .entry-content p {
        font-size: clamp(28px, -2px + 2.083vw, 38px);
    }
}

.single .entry-content p a,
.page .entry-content p a {
    color: var(--wp--preset--color--white);
    transition: all ease .3s;
}

.single .entry-content p a:hover,
.page .entry-content p a:hover {
    text-decoration: underline;
}

.entry-content p sup {
    line-height: 1;
}

.image-caption {
    display: grid;
    max-width: 1200px;
    gap: clamp(20px, 17.143px + 0.893vw, 30px);
    grid-template-columns: 1fr;
}

@media(min-width:768px) {
    .image-caption {
        grid-template-columns: 78% 1fr;
    }
}

.image-caption figcaption {
    font-size: clamp(12px, 11.429px + 0.179vw, 14px);
    line-height: 1.3;
}

.image-multiply img {
    mix-blend-mode: multiply;
}

/* El contenedor */
.galeria-interactiva.wp-block-gallery {
    display: grid !important;
    /* Definimos las columnas de los thumbnails */
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    gap: 15px !important;
    align-items: start;
}

/* La imagen principal: le decimos que ocupe todas las columnas */
.galeria-principal {
    grid-column: 1 / -1; 
    width: 100%;
    height: auto; 
    max-height: 600px; /* Opcional: para que una foto vertical no ocupe toda la pantalla */
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: opacity 0.25s ease-in-out;
    opacity: 1;
    display: block;
    background-color: rgba(255, 255, 255, .2);
}

/* Anulamos el ancho de WP para los thumbnails */
.galeria-interactiva.wp-block-gallery .wp-block-image,
.galeria-interactiva.wp-block-gallery figure.wp-block-image {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* Thumbnails cuadrados */
.galeria-interactiva.wp-block-gallery .wp-block-image img {
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
}

/* Highlight para la miniatura activa */
.galeria-interactiva.wp-block-gallery .wp-block-image img.active {
    border-color: var(--wp--preset--color--lilac-dark);
    opacity: 0.8;
}
.category-la-investigacion-forense .galeria-interactiva.wp-block-gallery .wp-block-image img.active {
    border-color: var(--wp--preset--color--green-dark);
}
/* Epigrafe */
.galeria-caption {
    grid-column: 1 / -1; 
    font-size: clamp(14px, 13.2px + 0.25vw, 18px);
    line-height: 1.3;
    color: var(--wp--preset--color--black);
    margin-bottom: 20px;
    text-align: center;
    transition: opacity 0.25s ease-in-out;
    min-height: 1.2em; /* Evita saltos de layout si no hay texto */
}

/* Ocultamos los epígrafes originales de los thumbnails para que no se dupliquen abajo */
.galeria-interactiva.wp-block-gallery figcaption {
    display: none !important;
}
.wp-block-gallery.has-nested-images figure.wp-block-image:has(figcaption):before {
    display: none !important;
}

.eaaf-social-links {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px;
    align-items: center;
}

.eaaf-social-link {
    border-radius: 999px;
    background-color: var(--wp--preset--color--lilac-light);
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .1s ease;
}

.eaaf-social-link:hover {
    transform: scale(1.1);
}

.eaaf-social-link a {
    display: block;
}

.eaaf-social-link svg {
    display: block;
}

.eaaf-social-link svg path {
    fill: #8c82b0;
}

.category-la-investigacion-forense .eaaf-social-link {
    background-color: var(--wp--preset--color--green-light);
}
.category-la-investigacion-forense .eaaf-social-link svg path {
    fill: #85947d;
}

.eaaf-compartir {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 0;
    position: relative;
}
@media(min-width:768px) {
    .eaaf-compartir {
        margin-top: 24px;
    }
}

.eaaf-compartir span {
    color: var(--wp--preset--color--black);
    font-size: clamp(15px, 12px + 0.938vw, 30px);
}

.eaaf-compartir a {
    display: block;
    height: 24px;
    transition: transform 0.3s ease;
}

.eaaf-compartir a:hover {
    transform: scale(1.1);
}

.eaaf-compartir a svg path, .eaaf-compartir button svg path {
    fill: var(--wp--preset--color--black);
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: inherit; /* Toma el color del texto del sitio */
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.copy-btn:hover {
    transform: scale(1.1);
}

.copy-btn svg {
    width: 24px;
    height: 24px;
}

/* Burbuja de confirmación */
.copy-status-bubble {
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--wp--preset--color--black) !important;
    color: #fff !important;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, bottom 0.3s ease;
    white-space: nowrap;
    font-family: var(--wp--preset--font-family--body-font) !important;
}

.copy-status-bubble.is-visible {
    opacity: 1;
    visibility: visible;
    bottom: 125%;
}

.share-btn-mobile { display: none; }
.share-group-desktop { display: flex; gap: 16px; align-items: center; }
.share-group-desktop svg {
    display: block;
}

@media (max-width: 768px) {
    .share-group-desktop { display: none; }
    .share-btn-mobile { display: inline-flex; align-items: center; background: none; border: none; cursor: pointer; padding: 0; }
}