/*
Theme Name: Memoria Sanvicentana
Theme URI: https://memoriasanvicentana.cl/
Author: Memoria Sanvicentana
Description: Tema patrimonial editorial y responsive, con identidad visual de sello histórico, compatible con el archivo Memoria Sanvicentana.
Version: 1.2.1
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: memoria-sanvicentana-theme
*/
:root {
  --ink:#153b35;--ink-dark:#0f302b;--green:#14493f;--green-deep:#103b35;
  --green-soft:#e7eeea;--gold:#bb9562;--gold-light:#e8ce98;
  --cream:#f7f5ef;--paper:#fffcf6;--white:#fff;
  --line:#e4e3d9;--muted:#66766e;--shadow:0 14px 42px rgba(19,52,44,.09);
  --radius:16px;--font-serif:Georgia,'Times New Roman',serif;
}
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:105px}
body{margin:0;color:var(--ink-dark);background:var(--cream);font:16px/1.65 system-ui,-apple-system,'Segoe UI',sans-serif;-webkit-font-smoothing:antialiased;overflow-x:hidden}
img,svg,iframe,video{max-width:100%}
img{height:auto}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
a{color:inherit;text-decoration:none}
a:hover{color:var(--green)}
a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid #be9358;outline-offset:3px}
.wrap{width:min(100% - 64px,1240px);margin-inline:auto}
.screen-reader-text{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.screen-reader-text:focus{z-index:1000;position:fixed!important;top:8px;left:8px;width:auto!important;height:auto!important;clip:auto!important;white-space:normal!important;padding:12px 18px!important;margin:0!important;background:#fff;color:#173e34;border-radius:8px}
.site-main{min-height:50vh}
.top{background:#0d2b27;color:#dce6df;font-size:11px;letter-spacing:.11em;text-transform:uppercase}
.top-inner{display:flex;align-items:center;justify-content:space-between;gap:20px;padding-top:8px;padding-bottom:8px}
.top-symbol{color:var(--gold-light);margin-right:8px}
.site-header{background:rgba(255,252,246,.97);border-bottom:1px solid #e5e1d5;position:sticky;top:0;z-index:50;box-shadow:0 6px 25px rgba(12,43,36,.045);backdrop-filter:blur(12px)}
.admin-bar .site-header{top:32px}
.header-inner{display:flex;align-items:center;justify-content:space-between;gap:28px;min-height:102px}
.brand{display:flex;align-items:center;gap:12px;flex-shrink:0;min-width:0;color:var(--ink-dark)}
.brand:hover{color:var(--ink-dark)}
.ms-brand-logo{display:block;width:78px;height:85px;object-fit:contain;flex-shrink:0;filter:drop-shadow(0 2px 2px rgba(48,43,29,.12))}
.brand-wordmark{display:flex;flex-direction:column;gap:6px}
.brand-wordmark strong{font:700 24px/.95 var(--font-serif);letter-spacing:-.035em;color:var(--ink-dark)}
.brand-wordmark small{font-size:9px;text-transform:uppercase;letter-spacing:.18em;color:#7a725f;font-weight:800}
.site-nav{display:flex;align-items:center;gap:24px;margin-left:auto}
.site-nav .ms-menu{list-style:none;display:flex;align-items:center;gap:clamp(15px,2vw,29px);padding:0;margin:0}
.site-nav .ms-menu li{list-style:none;margin:0;padding:0}
.site-nav .ms-menu a{position:relative;display:inline-flex;align-items:center;min-height:44px;font-weight:750;font-size:12px;letter-spacing:.02em;color:#345048}
.site-nav .ms-menu a::after{content:'';position:absolute;bottom:7px;left:0;width:100%;height:2px;transform:scaleX(0);transform-origin:left;background:var(--gold);transition:transform .22s ease}
.site-nav .ms-menu a:hover::after,.site-nav .ms-menu .current-menu-item>a::after,.site-nav .ms-menu .current_page_item>a::after{transform:scaleX(1)}
.nav-search{display:inline-flex;align-items:center;justify-content:center;gap:10px;background:var(--green);color:#fff;border-radius:9px;padding:12px 17px;font-size:12px;font-weight:800;white-space:nowrap;min-height:43px}
.nav-search:hover{background:#1c6657;color:#fff}
.icon-search,.search-glass{display:block;width:15px;height:15px;border:2px solid currentColor;border-radius:50%;position:relative;flex:none}
.icon-search::after,.search-glass::after{content:'';position:absolute;width:7px;height:2px;right:-6px;bottom:-3px;background:currentColor;transform:rotate(48deg);border-radius:5px}
.menu-toggle{display:none}
/* Hero: the client's stamp is an actual image asset, not a generic monogram. */
.hero-editorial{background:#123e37;isolation:isolate;color:var(--paper);position:relative;overflow:hidden}
.hero-editorial::before{content:'';position:absolute;inset:0;background:radial-gradient(circle at 76% 42%,rgba(208,177,116,.17),transparent 33%),linear-gradient(116deg,rgba(5,38,30,.54),transparent 68%);z-index:-1}
.hero-editorial::after{content:'';position:absolute;inset:0;opacity:.095;z-index:-1;background-image:repeating-linear-gradient(0deg,transparent 0 39px,rgba(250,241,211,.3) 40px 41px),repeating-linear-gradient(90deg,transparent 0 39px,rgba(250,241,211,.2) 40px 41px);pointer-events:none}
.hero-grid{display:grid;grid-template-columns:minmax(0,1.16fr) minmax(300px,.84fr);gap:clamp(24px,4.5vw,78px);align-items:center;padding-top:70px;padding-bottom:70px;position:relative;z-index:1}
.eyebrow{font-size:11px;color:#d9b47b;text-transform:uppercase;font-weight:800;letter-spacing:.19em;display:inline-flex;align-items:center;gap:13px}
.eyebrow-rule{display:inline-block;width:29px;height:2px;background:#d9b47b}
.hero-copy h1{font:normal clamp(44px,5.1vw,76px)/1.09 var(--font-serif);letter-spacing:-.045em;margin:22px 0;max-width:740px}
.hero-copy>p{font-size:17px;line-height:1.85;color:#d9e4dc;max-width:590px;margin:0}
.search{display:flex;align-items:stretch;gap:0;border-radius:12px;background:white;box-shadow:0 16px 40px rgba(0,0,0,.17);padding:6px;position:relative}
.hero-search{margin-top:34px;max-width:770px;scroll-margin-top:180px}
.search-glass{align-self:center;margin-left:17px;color:#547268;width:17px;height:17px}
.search input{min-width:0;flex:1;background:transparent;border:0;border-radius:8px;color:#123e37;padding:15px 16px;font-size:14px;outline:none}
.search input:focus-visible{outline:2px solid var(--gold);outline-offset:-2px}
.search input::placeholder{color:#72847a;opacity:1}
.search button{border:0;border-radius:8px;background:#c5a068;color:#173b34;display:inline-flex;align-items:center;justify-content:center;gap:12px;padding:12px 19px;min-height:49px;font-weight:800;font-size:12px;white-space:nowrap}
.search button:hover{background:#e0bf83}
.hero-suggestions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:19px;font-size:12px;color:#c0d0c4}
.hero-suggestions a{padding:5px 10px;color:#e6ebdf;border:1px solid rgba(255,255,255,.19);border-radius:40px}
.hero-suggestions a:hover{background:rgba(255,255,255,.14);color:#fff}
.hero-visual{position:relative;display:flex;align-items:center;justify-content:center;min-height:492px}
.hero-halo{position:absolute;inset:10% 2%;border:1px solid rgba(229,208,159,.3);border-radius:50%;transform:rotate(-19deg)}
.hero-halo::before,.hero-halo::after{content:'';position:absolute;inset:9%;border:1px dashed rgba(229,208,159,.24);border-radius:50%}
.hero-halo::after{inset:21%;border-style:solid}
.hero-stamp-frame{position:relative;z-index:1;width:min(100%,410px);padding:18px;transform:rotate(-5deg)}
.hero-stamp-frame::before{content:'';position:absolute;inset:0;background:rgba(4,36,28,.25);filter:blur(25px);transform:translateY(14px)}
.hero-logo.ms-brand-logo{width:100%;height:auto;max-height:435px;filter:drop-shadow(0 18px 30px rgba(6,26,20,.35))}
.hero-visual-caption{position:absolute;bottom:0;left:4%;display:flex;align-items:center;gap:11px;font-size:10px;text-transform:uppercase;letter-spacing:.19em;color:#d7b887}
.caption-line{width:28px;height:1px;background:currentColor}
.hero-side-note{position:absolute;right:-17px;top:50%;writing-mode:vertical-rl;font-size:9px;letter-spacing:.22em;color:#e3d4b2}
.hero-bottom{position:relative;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:24px;padding-top:17px;padding-bottom:17px;border-top:1px solid rgba(236,223,193,.22);font-size:11px;text-transform:uppercase;letter-spacing:.12em;color:#d6e2d7}
.hero-bottom a{color:#f6e6c6;font-weight:800}
/* Intro */
.archive-intro{background:#eae5d8;border-bottom:1px solid #dfd6c7}
.archive-intro-grid{display:flex;align-items:center;gap:28px;padding-top:29px;padding-bottom:29px}
.intro-sigil{font:46px var(--font-serif);color:#a3824b;line-height:1}
.archive-intro-grid>p{font:19px/1.55 var(--font-serif);color:#3a4d41;margin:0;max-width:780px}
.archive-intro-grid>p em{color:#927242}
.intro-stats{display:flex;gap:25px;margin-left:auto;flex-shrink:0}
.intro-stats>span{display:flex;flex-direction:column;align-items:flex-start}
.intro-stats strong{font:34px/1.1 var(--font-serif);color:var(--ink)}
.intro-stats small{font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:#758076}
.intro-stats .intro-stat-text{font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:#637164;white-space:nowrap}
/* Sections */
.section{padding:82px 0}
.sectionhead{display:flex;align-items:flex-end;justify-content:space-between;gap:25px;margin-bottom:31px}
.kicker{display:inline-block;color:#997b50;font-weight:900;font-size:11px;letter-spacing:.17em;text-transform:uppercase}
.sectionhead h2,.collections-copy h2,.participate-copy h2{font:normal clamp(33px,3.7vw,51px)/1.12 var(--font-serif);letter-spacing:-.035em;color:#183d35;margin:10px 0 12px}
.sectionhead p,.collections-copy p{color:var(--muted);margin:0;font-size:15px;line-height:1.8}
.viewall,.text-link{display:inline-flex;align-items:center;gap:8px;color:var(--green);font-size:13px;font-weight:850;white-space:nowrap;padding:8px 0;border-bottom:1px solid #aac1b4}
.viewall:hover,.text-link:hover{color:#9e7542;border-color:#9e7542}
.section-discover{background:#f9f8f3}
.tiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px}
.tile{position:relative;display:flex;flex-direction:column;gap:18px;min-width:0;min-height:235px;padding:27px;border-radius:14px;background:#fff;border:1px solid #e4e4d9;box-shadow:0 4px 18px rgba(23,58,46,.03);transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease}
.tile:hover{transform:translateY(-4px);box-shadow:var(--shadow);border-color:#c7b28e;color:var(--ink)}
.tile-icon{display:grid;place-items:center;width:49px;height:49px;border-radius:13px;background:#eaf0e9;color:#32675a;font:28px var(--font-serif)}
.tile-copy{display:flex;flex-direction:column;gap:7px;margin-top:auto}
.tile-copy b{font:24px/1.15 var(--font-serif);letter-spacing:-.025em}
.tile-copy small{font-size:12px;line-height:1.6;color:var(--muted)}
.tile-arrow{position:absolute;top:23px;right:22px;font-size:20px;color:#b59663}
.section-collections{padding-top:45px;padding-bottom:45px;background:#eae7dc}
.collections-panel{display:grid;grid-template-columns:.95fr 1.05fr;gap:55px;align-items:center}
.collections-copy h2{font-size:clamp(31px,3.4vw,45px)}
.collections-copy .text-link{margin-top:18px}
.collection-pills{display:flex;flex-wrap:wrap;gap:10px}
.collection-pills a,.collection-pills>span{display:inline-flex;align-items:center;gap:9px;border:1px solid #d8d4c5;border-radius:40px;background:#fffdf6;color:#38594b;font-weight:750;font-size:12px;padding:11px 16px;transition:border-color .2s,transform .2s}
.collection-pills a:hover{border-color:#b4945e;transform:translateY(-2px);color:#173e35}
.collection-pills a>span:first-child{color:#aa8756;font-size:12px}
.collection-count{display:inline-flex;align-items:center;justify-content:center;min-width:19px;border-radius:9px;padding:1px 5px;background:#eaf0e9;color:#456454;font-size:10px}
.section-documents{background:#fffdf8}
.section-research{background:#f1efe6}
.archive-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}
.archive-card{min-width:0;display:flex;flex-direction:column;background:#fff;border:1px solid #e2e5db;border-radius:15px;overflow:hidden;box-shadow:0 4px 15px rgba(15,49,37,.045);transition:transform .2s,box-shadow .2s}
.archive-card:hover{transform:translateY(-4px);box-shadow:var(--shadow)}
.card-image-link{position:relative;display:block;aspect-ratio:3/2;overflow:hidden;background:#d5ddcf}
.ms-card-img{width:100%;height:100%;object-fit:cover;transition:transform .4s;display:block}
.archive-card:hover .ms-card-img{transform:scale(1.035)}
.card-image-index{position:absolute;bottom:14px;left:15px;display:inline-flex;padding:5px 10px;border-radius:5px;background:rgba(15,48,40,.9);color:#fff;font-size:10px;font-weight:750;letter-spacing:.03em}
.archive-placeholder{height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;background:radial-gradient(circle at 70% 5%,#e4d2a9 0%,transparent 46%),linear-gradient(135deg,#e5e4d8,#bacbbd);color:#477161}
.archive-placeholder>span{font:65px/1 var(--font-serif);color:#769b83}
.archive-placeholder small{font-size:10px;letter-spacing:.16em;font-weight:900}
.cardbody{display:flex;flex:1;flex-direction:column;padding:24px}
.card-eyebrow{display:block;text-transform:uppercase;letter-spacing:.14em;font-size:10px;font-weight:900;color:#997b50}
.archive-card h3{font:normal 25px/1.18 var(--font-serif);letter-spacing:-.02em;margin:10px 0 14px;color:#173e35}
.archive-card h3 a:hover{color:#9e7542}
.archive-card .cardbody>p{margin:0 0 18px;color:#6a7972;font-size:13px;line-height:1.7}
.card-bottom{display:flex;align-items:flex-end;justify-content:space-between;flex-wrap:wrap;gap:9px;margin-top:auto;padding-top:15px;border-top:1px solid #e6e9df}
.card-date{font-size:11px;color:#6d776d;overflow-wrap:anywhere}
.card-read{display:inline-flex;align-items:center;gap:5px;font-size:12px;color:#1f6b5b;font-weight:850;margin-left:auto}
.ms-theme-empty{grid-column:1/-1;padding:28px;background:#fff;border:1px dashed #c9d5c9;border-radius:14px;color:#375348}
.ms-theme-empty strong{font:24px var(--font-serif)}
.ms-theme-empty p{margin-bottom:0;color:#64766c}
/* Participation */
.section-participate{background:#12453c;color:#fff}
.participate-grid{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:30px;align-items:center}
.participate-symbol{width:85px;height:85px;border:1px solid rgba(239,217,174,.45);border-radius:50%;display:grid;place-items:center;font:52px var(--font-serif);color:#d8b37d}
.participate-copy .kicker{color:#d8b37d}
.participate-copy h2{color:#fff;font-size:clamp(31px,3.4vw,47px);max-width:700px;margin-bottom:12px}
.participate-copy p{color:#d3e2d7;max-width:680px;margin:0;line-height:1.75;font-size:15px}
.participate-actions{max-width:235px}
.button-cream{display:inline-flex;align-items:center;justify-content:center;gap:12px;background:#e4c792;color:#21453b;border:0;border-radius:9px;padding:16px 20px;font-size:13px;font-weight:850;text-align:center}
.button-cream:hover{background:#f7e2b4;color:#21453b}
.participate-note{display:block;color:#e1d5b5;font-size:13px;line-height:1.8;border-left:2px solid #c7aa74;padding-left:16px}
.closing-quote{background:#eae5d8;text-align:center;padding:52px 0}
.closing-quote span{font-size:10px;letter-spacing:.2em;font-weight:900;color:#9a7a51}
.closing-quote p{max-width:820px;font:italic clamp(27px,3.5vw,42px)/1.35 var(--font-serif);margin:12px auto 0;color:#284b3c}
/* Footer */
.site-footer{background:#0d302a;color:#e2e9dd;padding:58px 0 0}
.footer-main{display:grid;grid-template-columns:1.5fr .75fr .9fr;gap:60px;padding-bottom:45px}
.footer-logo-link{display:inline-flex;align-items:center;gap:12px;color:#fff}
.footer-logo-link:hover{color:#fff}
.footer-logo{width:77px;height:88px}
.footer-logo-link strong{font:normal 25px/1 var(--font-serif);letter-spacing:-.03em;display:block}
.footer-logo-link small{display:block;margin-top:8px;color:#c5a570;font-size:10px;text-transform:uppercase;letter-spacing:.14em;font-weight:800}
.footer-about p{font-size:13px;line-height:1.8;max-width:330px;color:#b6ccc0;margin-top:18px}
.footer-links{display:flex;flex-direction:column;align-items:flex-start;gap:9px}
.footer-links h2{font-size:12px;text-transform:uppercase;letter-spacing:.15em;color:#d8b37e;margin:4px 0 9px}
.footer-links a{font-size:13px;color:#dae6db}
.footer-links a:hover{color:#e9c58c}
.footer-links p{font-size:13px;line-height:1.8;color:#b3c9bb;margin:5px 0}
.footer-bottom{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-top:18px;padding-bottom:22px;border-top:1px solid rgba(255,255,255,.17);font-size:11px;color:#aac1b5}
.footer-bottom a{color:#d5e1d7}
/* Inner pages */
.entry-hero{position:relative;overflow:hidden;background:#14463e;color:#f6f5ee;padding:55px 0 57px}
.entry-hero::before{content:'';position:absolute;right:-10%;top:-70%;width:40vw;height:40vw;border:1px solid rgba(218,193,149,.21);border-radius:50%;box-shadow:0 0 0 75px rgba(218,193,149,.035),0 0 0 160px rgba(218,193,149,.025);pointer-events:none}
.entry-hero .wrap{position:relative;z-index:1}
.breadcrumbs{display:flex;align-items:center;gap:11px;flex-wrap:wrap;font-size:12px;color:#cadacf;margin-bottom:19px}
.breadcrumbs a{color:#f2dfb7}
.breadcrumbs a:hover{color:#fff;text-decoration:underline}
.entry-hero h1{font:normal clamp(35px,4.6vw,61px)/1.13 var(--font-serif);margin:13px 0 8px;letter-spacing:-.03em;max-width:900px;overflow-wrap:anywhere}
.entry-hero p,.entry-description{font-size:15px;color:#cbdccf;margin:10px 0 0;max-width:770px}
.entry-meta{font-size:13px!important;color:#e4c798!important}
.results-section{background:#f8f7f1}
.results-search{max-width:700px;margin-bottom:20px;border:1px solid #e3e7de;box-shadow:none}
.results-count{font-size:13px;color:#6a7b71;margin:14px 0 24px}
.collection-filters{display:flex;flex-wrap:wrap;align-items:center;gap:9px;margin-bottom:26px}
.collection-filters strong{font-size:12px;margin-right:4px;color:#375c4e}
.collection-filters a{font-size:12px;font-weight:750;padding:8px 14px;border:1px solid #d9e1d8;border-radius:24px;background:#fff}
.collection-filters a:hover{color:#15463d;border-color:#b9a07a;background:#fffdfa}
.pagination{margin-top:40px}
.pagination .nav-links{display:flex;justify-content:center;gap:7px;flex-wrap:wrap}
.pagination .page-numbers{display:inline-flex;align-items:center;justify-content:center;min-width:40px;min-height:40px;border:1px solid #dfe4db;border-radius:8px;background:#fff;font-size:13px;font-weight:750;padding:8px 14px}
.pagination .current{background:#1d5d50;border-color:#1d5d50;color:#fff}
.section-single{background:#f7f6ef}
.single-layout{display:grid;grid-template-columns:minmax(0,1.85fr) minmax(255px,.7fr);gap:30px;align-items:start}
.single-content,.single-side{min-width:0;background:#fff;border:1px solid #e2e5dc;border-radius:15px;box-shadow:0 3px 14px rgba(19,52,44,.035)}
.single-content{padding:clamp(20px,3vw,38px);overflow-wrap:anywhere}
.single-content img{max-width:100%;height:auto;border-radius:8px}
.single-cover{display:block;margin-bottom:25px;width:100%;max-height:560px;object-fit:contain}
.single-side{padding:27px;position:sticky;top:130px}
.admin-bar .single-side{top:165px}
.single-side h2{font:normal 27px var(--font-serif);margin:7px 0 20px}
.single-side dl{margin:0}
.single-side dt{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#77877c;font-weight:850;margin-top:15px}
.single-side dd{margin:3px 0 13px;font-size:14px;color:#294b40;overflow-wrap:anywhere}
.back-link{display:inline-block;margin-top:20px;padding-top:17px;border-top:1px solid #e4e9e0;width:100%;font-weight:800;font-size:13px;color:#245e50}
.content-prose{font-size:16px;line-height:1.85;color:#30453a}
.content-prose h2,.content-prose h3{font-family:var(--font-serif);line-height:1.25;color:#163e35}
.content-prose h2{font-size:clamp(25px,3vw,36px)}
.content-prose blockquote{background:#f1f3ec;border-left:4px solid var(--gold);padding:16px 22px;margin-left:0;margin-right:0}
.content-prose a:not(.msad-download){text-decoration:underline;text-decoration-color:#bd9e69;text-underline-offset:3px}
.content-prose ul,.content-prose ol{padding-left:24px}
.content-prose table{display:block;overflow-x:auto;max-width:100%;border-collapse:collapse}
.content-prose td,.content-prose th{padding:9px;border:1px solid #dfe4db}
.page-content{max-width:920px;margin-inline:auto}
.research-related{margin-top:35px;padding-top:22px;border-top:1px solid #e2e7dc}
.related-list{display:grid;gap:10px}
.related-list a{display:flex;align-items:center;gap:12px;text-decoration:none!important;background:#f3f5ee;border:1px solid #e4e9e1;border-radius:9px;padding:12px 15px;color:#285b4e;font-weight:750;font-size:13px}
.related-list a span:last-child{margin-left:auto}
.related-list a:hover{background:#e8f0e8}
/* Compatible with the plugin's public file preview. */
.single-content .msad-detail{max-width:100%;overflow-wrap:anywhere}
.single-content .msad-detail-head h2{font-size:26px}
.single-content .msad-preview,.single-content .msad-detail-image,.single-content .msad-document-viewer,.single-content .msad-drive-viewer{max-width:100%;overflow:hidden}
.single-content .msad-document-viewer iframe,.single-content .msad-drive-viewer iframe{max-width:100%;width:100%}
.single-content .msad-metadata{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.single-content .msad-metadata>div{min-width:0;overflow-wrap:anywhere}
.single-content .msad-download{display:inline-block;border-radius:9px;padding:11px 16px;text-decoration:none;background:#205f50;color:#fff;font-weight:750;font-size:13px}
.single-content .msad-download:hover{background:#16483d;color:#fff}
/* Editor / Gutenberg safety */
.wp-block-image img,.wp-caption img,.alignwide,.alignfull{max-width:100%;height:auto}
.wp-caption{max-width:100%}
.wp-block-embed iframe{max-width:100%}
/* Responsive */
@media(max-width:1120px){
  .wrap{width:min(100% - 46px,1240px)}
  .hero-grid{gap:20px;grid-template-columns:minmax(0,1.1fr) minmax(260px,.9fr)}
  .hero-stamp-frame{width:min(100%,360px)}
  .hero-visual{min-height:430px}
  .hero-copy h1{font-size:clamp(42px,5vw,64px)}
  .tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
  .tile{min-height:195px}
  .footer-main{gap:35px}
}
@media(max-width:960px){
  .header-inner{min-height:83px;position:relative;gap:10px}
  .ms-brand-logo{width:64px;height:72px}
  .brand-wordmark strong{font-size:21px}
  .menu-toggle{margin-left:auto;display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:44px;background:#f0f3ed;border:1px solid #d8dfd5;border-radius:9px;padding:8px 12px;color:#163e35;font-size:12px;font-weight:850}
  .menu-lines{display:flex;flex-direction:column;gap:4px}
  .menu-lines i{display:block;width:19px;height:2px;border-radius:5px;background:#2e6354}
  .site-nav{display:none;position:absolute;z-index:100;top:100%;left:0;right:0;margin:0;padding:14px;background:#fffdf8;border:1px solid #e4e5d9;border-radius:0 0 14px 14px;box-shadow:0 18px 30px rgba(11,48,35,.13);max-height:calc(100dvh - 110px);overflow-y:auto}
  .site-nav.is-open{display:flex;flex-direction:column;align-items:stretch;gap:10px}
  .site-nav .ms-menu{display:flex;flex-direction:column;align-items:stretch;gap:0}
  .site-nav .ms-menu li{width:100%}
  .site-nav .ms-menu a{display:flex;width:100%;min-height:46px;border-bottom:1px solid #edf0e8;padding:11px 8px;font-size:14px}
  .site-nav .ms-menu a::after{display:none}
  .nav-search{justify-content:center;width:100%;min-height:46px}
  .hero-grid{grid-template-columns:minmax(0,1fr) minmax(220px,.65fr);padding-top:54px;padding-bottom:54px}
  .hero-visual{min-height:355px}
  .hero-stamp-frame{width:min(100%,310px)}
  .hero-visual-caption,.hero-side-note{display:none}
  .archive-intro-grid>p{font-size:17px}
  .archive-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .collections-panel{gap:27px}
  .participate-grid{grid-template-columns:auto 1fr}
  .participate-actions{grid-column:2}
  .single-layout{grid-template-columns:1fr}
  .single-side{position:static}
}
@media(max-width:700px){
  .wrap{width:min(100% - 36px,1240px)}
  .top-inner{font-size:9px}
  .top-inner>span:last-child{display:none}
  .header-inner{min-height:78px}
  .hero-grid{grid-template-columns:1fr;padding-top:51px;padding-bottom:26px}
  .hero-copy h1{font-size:clamp(39px,9vw,60px);max-width:650px;margin-top:19px}
  .hero-copy>p{font-size:15px;line-height:1.75}
  .hero-visual{min-height:258px;padding-top:8px;overflow:hidden}
  .hero-halo{inset:5% 23%;border-radius:50%}
  .hero-stamp-frame{width:195px;padding:5px;transform:rotate(-4deg)}
  .hero-logo.ms-brand-logo{width:100%;height:auto;max-height:230px}
  .hero-bottom{font-size:10px;align-items:flex-start}
  .archive-intro-grid{gap:17px;flex-wrap:wrap;padding-top:24px;padding-bottom:24px}
  .intro-sigil{font-size:34px}
  .archive-intro-grid>p{flex:1 1 240px}
  .intro-stats{width:100%;margin-left:0;padding-left:53px}
  .section{padding:57px 0}
  .sectionhead{align-items:flex-start;flex-direction:column;gap:12px;margin-bottom:24px}
  .sectionhead h2{font-size:clamp(31px,6vw,43px)}
  .collections-panel{grid-template-columns:1fr;gap:20px}
  .section-collections{padding-top:36px;padding-bottom:36px}
  .archive-grid{gap:16px}
  .archive-card h3{font-size:22px}
  .cardbody{padding:19px}
  .participate-grid{grid-template-columns:1fr;gap:18px}
  .participate-symbol{width:62px;height:62px;font-size:38px}
  .participate-actions{grid-column:auto;max-width:none}
  .footer-main{grid-template-columns:1fr 1fr;gap:28px}
  .footer-about{grid-column:1/-1}
  .footer-bottom{flex-wrap:wrap}
  .entry-hero{padding:45px 0}
  .section-single{padding:42px 0}
}
@media(max-width:520px){
  .brand{gap:7px}
  .ms-brand-logo{width:53px;height:62px}
  .brand-wordmark strong{font-size:18px}
  .brand-wordmark small{font-size:8px;letter-spacing:.1em}
  .menu-caption{font-size:11px}
  .hero-copy h1{font-size:clamp(37px,10.4vw,49px)}
  .eyebrow{font-size:9px;letter-spacing:.13em;gap:7px}
  .eyebrow-rule{width:18px}
  .hero-search{flex-wrap:wrap;margin-top:25px;padding:5px}
  .hero-search .search-glass{margin-left:13px}
  .hero-search input{flex:1 1 calc(100% - 65px);min-height:48px;padding:11px;font-size:13px}
  .hero-search button{width:100%;min-height:46px}
  .hero-suggestions{font-size:10px;gap:7px}
  .hero-visual{min-height:230px}
  .hero-stamp-frame{width:172px}
  .hero-bottom{flex-direction:column;gap:9px}
  .intro-stats{padding-left:0}
  .tiles{grid-template-columns:1fr;gap:10px}
  .tile{min-height:0;display:grid;grid-template-columns:45px minmax(0,1fr);gap:14px;align-items:center;padding:16px 18px}
  .tile-icon{width:45px;height:45px}
  .tile-copy{margin:0;padding-right:15px}
  .tile-copy b{font-size:21px}
  .tile-arrow{right:12px;top:17px}
  .archive-grid{grid-template-columns:1fr}
  .archive-card .card-image-link{aspect-ratio:16/10}
  .cardbody{padding:20px}
  .collection-pills a,.collection-pills>span{font-size:11px;padding:9px 12px}
  .single-content{padding:19px}
  .single-side{padding:21px}
  .single-content .msad-metadata{grid-template-columns:1fr}
  .footer-main{grid-template-columns:1fr}
  .footer-about{grid-column:auto}
  .footer-logo{width:65px;height:75px}
  .footer-bottom{flex-direction:column;align-items:flex-start}
  .closing-quote{padding:43px 0}
  .closing-quote p{font-size:27px}
}
@media(max-width:359px){.brand-wordmark strong{font-size:16px}.brand-wordmark small{font-size:7px}.ms-brand-logo{width:47px;height:54px}.menu-caption{display:none}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{transition:none!important;animation:none!important}}

/* v1.2.1 — Fichas documentales a página completa, sin columna lateral. */
body.single-msad_documento .section-single-document{padding-block:clamp(20px,3.8vw,54px);background:#f5f5ef}
body.single-msad_documento .section-single-document .wrap-document{width:min(calc(100% - 56px),1520px);max-width:none}
body.single-msad_documento .single-layout-full{display:block!important;grid-template-columns:none!important;width:100%;max-width:none}
body.single-msad_documento .single-content-document{display:block;width:100%;max-width:none;min-width:0;padding:clamp(16px,2.6vw,38px);border-radius:18px;overflow:visible}
body.single-msad_documento .single-content-document .msad-detail{display:block;width:100%;max-width:none!important;min-width:0;margin:0;padding:0!important}
body.single-msad_documento .single-content-document .msad-detail-head{background:#edf3ef;border-radius:14px;padding:clamp(18px,2.7vw,34px);margin-bottom:clamp(16px,2.5vw,28px)}
body.single-msad_documento .single-content-document .msad-detail-head h2{font:normal clamp(24px,3vw,40px)/1.22 var(--font-serif);overflow-wrap:anywhere}
body.single-msad_documento .single-content-document .msad-preview,
body.single-msad_documento .single-content-document .msad-detail-image,
body.single-msad_documento .single-content-document .msad-document-viewer,
body.single-msad_documento .single-content-document .msad-drive-viewer{display:block;width:100%;max-width:100%;min-width:0;box-sizing:border-box;overflow:hidden}
body.single-msad_documento .single-content-document .msad-preview{margin:0 0 clamp(20px,3vw,36px);border-radius:14px}
body.single-msad_documento .single-content-document .msad-image-viewer{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
body.single-msad_documento .single-content-document .msad-image-viewer .msad-lightbox-trigger{display:flex;align-items:center;justify-content:center;width:100%;max-width:100%;min-width:0}
/* Fill the available reading column without cropping the original image. */
body.single-msad_documento .single-content-document .msad-preview img.msad-original-image,
body.single-msad_documento .single-content-document .msad-detail-image img{display:block;width:100%!important;max-width:100%!important;height:auto!important;max-height:none!important;object-fit:contain!important;margin:0 auto!important}
body.single-msad_documento .single-content-document .msad-image-viewer .msad-historical-caption{width:100%;max-width:none;border-radius:0 0 12px 12px}
body.single-msad_documento .single-content-document .msad-document-viewer iframe,
body.single-msad_documento .single-content-document .msad-drive-viewer iframe{width:100%!important;max-width:none!important;height:min(90vh,1120px)!important;min-height:540px;border:0}
body.single-msad_documento .single-content-document .msad-detail-text{width:100%;max-width:1050px;margin:28px 0 36px;color:#30483f;font-size:clamp(15px,1.4vw,17px);line-height:1.8}
body.single-msad_documento .single-content-document .msad-detail-text h3{font:normal clamp(24px,2.3vw,32px)/1.3 var(--font-serif);margin:0 0 15px}
/* Metadata is kept below the document as a horizontal, responsive information grid. */
body.single-msad_documento .single-content-document .msad-metadata{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:30px 0 22px;padding-top:27px;border-top:1px solid #dce6df}
body.single-msad_documento .single-content-document .msad-metadata>div{display:block;min-width:0;overflow-wrap:anywhere;margin:0;padding:17px 20px;border:1px solid #e2e7dd;background:#f8faf6;border-radius:11px}
body.single-msad_documento .single-content-document .msad-metadata dt{display:block;font-size:11px;line-height:1.5;font-weight:850;letter-spacing:.09em;text-transform:uppercase;color:#687c71;margin:0 0 7px}
body.single-msad_documento .single-content-document .msad-metadata dd{display:block;font-size:15px;line-height:1.6;color:#173c33;margin:0;word-break:normal;overflow-wrap:anywhere}
body.single-msad_documento .single-content-document .msad-download{min-height:46px;display:inline-flex;align-items:center;justify-content:center;padding:12px 19px;font-size:14px}
body.single-msad_documento .document-bottom-nav{display:flex;align-items:center;justify-content:flex-start;margin-top:18px}
body.single-msad_documento .document-back-link{display:inline-flex;align-items:center;gap:10px;color:#155246;font-size:14px;font-weight:800;padding:13px 16px;background:#fff;border:1px solid #d6e2d9;border-radius:10px;min-height:48px;transition:background .2s,border-color .2s}
body.single-msad_documento .document-back-link:hover{background:#eaf1eb;border-color:#acc8b8;color:#0c3a30}
@media(max-width:1040px){
  body.single-msad_documento .single-content-document .msad-metadata{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  body.single-msad_documento .section-single-document .wrap-document{width:min(calc(100% - 24px),1520px)}
  body.single-msad_documento .section-single-document{padding-block:15px 30px}
  body.single-msad_documento .single-content-document{padding:13px;border-radius:13px}
  body.single-msad_documento .single-content-document .msad-detail-head{padding:18px 15px;margin-bottom:15px}
  body.single-msad_documento .single-content-document .msad-metadata{grid-template-columns:1fr;gap:8px;margin-top:22px;padding-top:20px}
  body.single-msad_documento .single-content-document .msad-metadata>div{padding:12px 14px}
  body.single-msad_documento .single-content-document .msad-document-viewer iframe,
  body.single-msad_documento .single-content-document .msad-drive-viewer iframe{height:70vh!important;min-height:380px}
  body.single-msad_documento .single-content-document .msad-download{width:100%;text-align:center}
  body.single-msad_documento .document-bottom-nav{margin-top:12px}
  body.single-msad_documento .document-back-link{width:100%;justify-content:center}
}
@media(max-width:380px){
  body.single-msad_documento .section-single-document .wrap-document{width:min(calc(100% - 16px),1520px)}
  body.single-msad_documento .single-content-document{padding:9px}
  body.single-msad_documento .single-content-document .msad-image-viewer{padding:6px!important}
}
/* The page hero is the single canonical title; avoid a repeated heading above the viewer. */
body.single-msad_documento .single-content-document .msad-detail-head{display:none}
