/* Cabecera compartida: identidad, utilidades y navegación. */
.genoteca-masthead { background: #fff; color: #173d35; }
.masthead-top { display: grid; grid-template-columns: 1fr minmax(220px, 360px) 1fr; align-items: center; gap: 32px; padding: 20px 0 18px; }
.masthead-brand { display: inline-flex; width: fit-content; }
.masthead-brand img { width: 144px; height: 72px; object-fit: contain; }
.masthead-search .form-inline { width: 100%; margin: 0; }
.masthead-search .input-group { display: flex; align-items: stretch; flex-wrap: nowrap; padding: 0; height: 44px; background: #f2f6f4; border: 1px solid var(--genoteca-navbar-green-color); border-radius: 6px; }
.masthead-search .input-group:focus-within { border-color: #0071bb; background: #fff; }
.masthead-search .form-control { min-width: 0; height: 42px; margin: 0; background: transparent; border: 0; border-radius: 5px 0 0 5px; padding: 0 14px; color: #173d35; font-size: 14px; box-shadow: none; }
.masthead-search .form-control::placeholder { color: #52655e; opacity: 1; }
.masthead-search .input-group-append { display: flex; flex: 0 0 46px; margin: 0; }
.masthead-search .input-group-text { display: flex; align-items: center; justify-content: center; width: 46px; height: 42px; padding: 0; border: 0; border-radius: 0 5px 5px 0; background: var(--genoteca-navbar-green-color); color: white; }
.genoteca-masthead .genoteca-languages { justify-self: end; margin: 0; gap: 3px; padding: 4px; background: #f2f6f4; border-radius: 24px; font-size: 12px; }
.genoteca-masthead .genoteca-languages a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; color: #52655e; text-decoration: none; border-radius: 20px; }
.genoteca-masthead .genoteca-languages a[aria-current="page"] { background: white; color: #006d20; box-shadow: 0 1px 5px #173d3510; font-weight: 700; }
.masthead-navigation, .masthead-links { display: flex; align-items: center; gap: 22px; }
.masthead-navigation { justify-content: space-between; padding: 0 0 12px; position: relative; }
.masthead-links { flex-wrap: wrap; min-width: 0; gap: 4px 22px; }
.masthead-navigation a, .masthead-topics summary { color: var(--genoteca-navbar-green-color); text-decoration: none; font-size: 14px; font-weight: 700; }
.masthead-links > a, .masthead-topics summary { display: inline-flex; align-items: center; min-height: 44px; }
.masthead-navigation a:hover, .masthead-topics summary:hover { color: var(--genoteca-blue-color); }
.masthead-topics { position: static; }
.masthead-topics summary { list-style: none; cursor: pointer; gap: 8px; }
.masthead-topics summary::-webkit-details-marker { display: none; }
.masthead-topics[open] summary span { transform: rotate(180deg); }
.masthead-topic-panel { position: absolute; z-index: 100; top: 100%; left: 0; width: min(680px, 100%); padding: 24px; border-radius: 16px; background: #fff; box-shadow: 0 12px 40px #173d3524; }
.masthead-topic-panel .row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; margin: 0; }
.masthead-topic-panel .col-sm-3 { width: auto; max-width: none; padding: 0; }
.masthead-topic-panel ul { list-style: none; padding: 0; margin: 0; }
.masthead-topic-panel li { margin: 0; }
.masthead-topic-panel a { display: block; padding: 8px 0; font-size: 13px; line-height: 1.5; font-weight: 400; }
.masthead-topic-panel a.first-item { color: var(--genoteca-navbar-green-color); font-weight: 700; }
.masthead-topic-panel a.first-item:hover { color: var(--genoteca-blue-color); }
.genoteca-masthead .masthead-newsletter { display: inline-flex; justify-self: end; align-items: center; gap: 10px; min-height: 42px; padding: 0 17px; background: #eaf5ee; color: #006d20; border-radius: 6px; white-space: nowrap; text-decoration: none; font-size: 14px; font-weight: 700; }
.genoteca-masthead .masthead-newsletter:hover { background: #dcefe3; }
.genoteca-masthead a:focus-visible, .genoteca-masthead summary:focus-visible, .genoteca-masthead button:focus-visible { outline: 3px solid #0071bb; outline-offset: 4px; }

.masthead-desktop-languages { justify-self: end; }
.masthead-toggle,.masthead-search-toggle,.masthead-mobile-languages { display:none; }
@media(max-width:1199px){
 .masthead-top{grid-template-columns:44px 1fr 44px;gap:12px;padding:10px 0;min-height:80px;}
 .masthead-brand{grid-column:2;grid-row:1;justify-self:center;}
 .masthead-brand img{width:112px;height:56px;}
 .masthead-toggle,.masthead-search-toggle{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border:0;border-radius:5px;background:white;color:var(--genoteca-navbar-green-color);}
 .masthead-toggle{grid-column:1;grid-row:1;}
 .masthead-search-toggle{grid-column:3;grid-row:1;}
 .masthead-toggle:hover,.masthead-search-toggle:hover{color:var(--genoteca-blue-color);background:#f2f6f4;}
 .masthead-desktop-languages{display:none;}
 .masthead-search{grid-column:1/-1;grid-row:2;padding:4px 0 8px;}
 .masthead-navigation{display:block;padding:8px 0 20px;}
 .masthead-links{display:flex;flex-direction:column;align-items:stretch;gap:0;margin:14px 0;}
 .masthead-links>a,.masthead-topics summary{min-height:48px;font-size:15px;}
 .masthead-topics summary{width:100%;justify-content:space-between;}
 .masthead-mobile-languages{display:block;}
 .masthead-mobile-languages .genoteca-languages{width:fit-content;}
 .masthead-topic-panel{position:static;width:100%;max-height:none;box-shadow:none;border-radius:0;padding:8px 12px 16px;}
 .masthead-topic-panel .row{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;}
 .masthead-topic-panel a{min-height:44px;}
 .masthead-enhanced:not(.menu-open) .masthead-navigation{display:none;}
 .masthead-enhanced:not(.search-open) .masthead-search{display:none;}
}

.masthead-topic-archive { margin-top: 12px; padding-top: 6px; border-top: 1px solid var(--night-rule, #d8e1dd); }
