/*
Theme Name: COPTO APK V3.2
Theme URI: https://copto.es
Author: COPTO.ES
Description: Tema profesional mobile-first para COPTO.ES con noticias, menú en dos columnas, tres idiomas y panel de personalización.
Version: 3.2.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: copto-apk-v2
*/

:root{
  --copto-blue:#174D84;
  --copto-accent:#B48F53;
  --copto-wine:#70272C;
  --copto-bg:#FFFFFF;
  --copto-card:#FFFFFF;
  --copto-text:#232323;
  --copto-muted:#6E6E6E;
  --copto-line:#E8E8E8;
  --copto-shadow:0 8px 28px rgba(10,35,60,.08);
  --copto-radius:18px;
  --copto-icon-size:84px;
  --copto-font-scale:1;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background-color:var(--copto-bg);
  color:var(--copto-text);
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:calc(16px * var(--copto-font-scale));
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  padding-bottom:70px;
}
a{color:inherit}
img{max-width:100%;height:auto}
button,input,select,textarea{font:inherit}
button{cursor:pointer}

.copto-topbar{position:sticky;top:0;z-index:80;background:var(--copto-blue);color:#fff;box-shadow:0 5px 20px rgba(0,29,58,.12)}
.copto-topbar-inner{max-width:1240px;min-height:68px;margin:auto;padding:8px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.copto-brand{display:flex;align-items:center;gap:10px;text-decoration:none;min-width:0}
.copto-brand-cross{color:#F4D798;font-size:31px;line-height:1}
.copto-brand-text{display:flex;flex-direction:column;min-width:0}
.copto-brand-title{font-family:Georgia,"Times New Roman",serif;font-weight:700;font-size:21px;line-height:1.05}
.copto-brand-subtitle{font-size:9px;letter-spacing:.7px;text-transform:uppercase;opacity:.77;margin-top:3px}
.copto-top-actions{display:flex;align-items:center;gap:3px}
.copto-icon-button{border:0;background:transparent;color:#fff;min-width:42px;min-height:42px;padding:6px;border-radius:11px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-decoration:none}
.copto-icon-button:hover,.copto-icon-button:focus-visible{background:rgba(255,255,255,.12);outline:none}
.copto-icon-glyph{font-size:19px;line-height:1}
.copto-icon-label{display:none;font-size:9px;margin-top:2px}

.copto-main{max-width:1240px;margin:auto;padding:20px 14px 40px}

/* News */
.copto-news{margin-bottom:26px}
.copto-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px}
.copto-section-head h2{margin:0;font:700 20px/1.2 Georgia,"Times New Roman",serif;color:var(--copto-blue)}
.copto-section-head a{font-size:12px;color:var(--copto-blue);text-decoration:none;font-weight:700}
.copto-news-track{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(270px,88%);gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;padding:2px 2px 10px;scrollbar-width:thin}
.copto-news-card{scroll-snap-align:start;position:relative;min-height:150px;border:1px solid var(--copto-line);border-radius:16px;overflow:hidden;background:var(--copto-card);box-shadow:var(--copto-shadow);text-decoration:none;display:grid;grid-template-columns:118px 1fr}
.copto-news-image{width:118px;height:100%;min-height:150px;object-fit:cover;background:#f1f1f1}
.copto-news-placeholder{width:118px;min-height:150px;background:linear-gradient(145deg,var(--copto-blue),#2f6ba4);display:grid;place-items:center;color:#fff;font-size:34px}
.copto-news-copy{padding:14px 13px;display:flex;flex-direction:column;justify-content:center;min-width:0}
.copto-news-date{font-size:10px;text-transform:uppercase;letter-spacing:.5px;color:var(--copto-muted);margin-bottom:5px}
.copto-news-copy h3{margin:0 0 6px;font:700 17px/1.25 Georgia,"Times New Roman",serif;color:var(--copto-blue)}
.copto-news-copy p{margin:0;color:var(--copto-muted);font-size:12px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}

/* Hero / services */
.copto-welcome{text-align:center;max-width:760px;margin:4px auto 22px}
.copto-welcome h1{margin:0 0 5px;font:700 clamp(26px,6vw,38px)/1.1 Georgia,"Times New Roman",serif;color:var(--copto-blue)}
.copto-welcome p{margin:0;color:var(--copto-muted);font-size:13px}
.copto-home-search{position:relative;max-width:640px;margin:18px auto 26px}
.copto-home-search input{width:100%;min-height:50px;padding:11px 48px 11px 16px;border:1px solid var(--copto-line);border-radius:14px;background:var(--copto-card);color:var(--copto-text);box-shadow:0 7px 20px rgba(10,35,60,.05)}
.copto-home-search button{position:absolute;right:5px;top:5px;width:40px;height:40px;border:0;border-radius:10px;background:var(--copto-blue);color:#fff}

/* Cuadrícula responsive: dos columnas reales, sin desplazamiento horizontal. */
.copto-services-shell{position:relative}
.copto-services{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:5px 2px 14px;max-width:940px;margin-inline:auto}
.copto-service-card{scroll-snap-align:start;text-decoration:none;border:1px solid var(--copto-line);border-radius:var(--copto-radius);background:var(--copto-card);min-height:148px;padding:15px 10px 12px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;box-shadow:0 6px 20px rgba(10,35,60,.055);transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}
.copto-service-card:hover,.copto-service-card:focus-visible{transform:translateY(-2px);box-shadow:0 11px 28px rgba(10,35,60,.10);border-color:color-mix(in srgb,var(--copto-blue) 35%,var(--copto-line));outline:none}
.copto-service-icon{width:var(--copto-icon-size);height:var(--copto-icon-size);display:grid;place-items:center;margin-bottom:8px}
.copto-service-icon img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 4px 5px rgba(0,0,0,.08))}
.copto-service-card strong{font:700 16px/1.15 Georgia,"Times New Roman",serif;color:var(--copto-blue)}
.copto-service-card small{margin-top:5px;font-size:10px;line-height:1.3;color:var(--copto-muted)}

.copto-content-card{background:var(--copto-card);border:1px solid var(--copto-line);border-radius:var(--copto-radius);box-shadow:var(--copto-shadow);padding:20px;max-width:920px;margin:10px auto 30px}
.copto-content-card h1,.copto-content-card h2,.copto-content-card h3{color:var(--copto-blue);font-family:Georgia,"Times New Roman",serif}
.copto-content-card a{color:var(--copto-blue)}

.copto-bottom-nav{position:fixed;left:0;right:0;bottom:0;z-index:90;display:grid;grid-template-columns:repeat(4,1fr);min-height:64px;padding:5px max(6px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));background:color-mix(in srgb,var(--copto-blue) 97%,transparent);box-shadow:0 -5px 20px rgba(0,29,58,.12)}
.copto-nav-item{border:0;background:transparent;color:#fff;text-decoration:none;min-height:52px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border-radius:10px;font-size:10px}
.copto-nav-item:hover,.copto-nav-item:focus-visible,.copto-nav-item.is-active{background:rgba(255,255,255,.11);outline:none}
.copto-nav-symbol{font-size:19px;line-height:1}

.copto-modal[hidden]{display:none!important}.copto-modal{position:fixed;inset:0;z-index:120;background:rgba(0,0,0,.36);display:grid;place-items:end center;padding:14px}.copto-modal-panel{width:100%;max-width:520px;max-height:80vh;overflow:auto;background:var(--copto-card);border:1px solid var(--copto-line);border-radius:18px;padding:18px;box-shadow:0 24px 70px rgba(0,0,0,.25)}
.copto-modal-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}.copto-modal-head h2{margin:0;color:var(--copto-blue);font-family:Georgia,"Times New Roman",serif}.copto-close{width:40px;height:40px;border:1px solid var(--copto-line);border-radius:10px;background:#f3f3f3;color:var(--copto-text)}
.copto-modal-search{width:100%;min-height:48px;border:1px solid var(--copto-line);background:#fff;color:#222;border-radius:12px;padding:10px 13px}.copto-search-submit{width:100%;margin-top:10px;min-height:46px;border:0;border-radius:10px;background:var(--copto-blue);color:#fff;font-weight:700}
.copto-setting-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 0;border-top:1px solid var(--copto-line)}.copto-setting-controls{display:flex;gap:6px}.copto-setting-controls button,.copto-switch{min-width:42px;min-height:38px;border:1px solid var(--copto-line);border-radius:9px;background:#f5f5f5;color:#222}
.copto-footer{padding:24px 16px 16px;text-align:center;color:var(--copto-muted);font-size:11px}
.screen-reader-text{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

body.copto-dark{--copto-bg:#17191c;--copto-card:#22262b;--copto-text:#f2f2f2;--copto-muted:#b6b8bb;--copto-line:#363b41}
body.copto-dark .copto-modal-search{background:#1c1f23;color:#fff}
body.copto-dark .copto-close,body.copto-dark .copto-setting-controls button,body.copto-dark .copto-switch{background:#30353b;color:#fff}

@media(min-width:600px){
  body{padding-bottom:0}.copto-main{padding:28px 22px 54px}.copto-icon-label{display:block}.copto-bottom-nav{display:none}.copto-modal{place-items:center}
  .copto-news-track{grid-auto-columns:minmax(340px,48%)}
  .copto-services{gap:15px}.copto-service-card{min-height:164px}.copto-service-card strong{font-size:18px}.copto-service-card small{font-size:11px}
}
@media(min-width:1000px){
  .copto-topbar-inner{padding-inline:28px}.copto-brand-title{font-size:25px}.copto-main{padding:34px 28px 60px}
  .copto-news-track{grid-auto-flow:initial;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-columns:auto;overflow:visible}.copto-news-card{min-height:164px}
  .copto-services{gap:16px}.copto-service-card{min-height:176px;padding:18px 12px}.copto-service-icon{width:var(--copto-icon-size);height:var(--copto-icon-size)}
}

/* Selector de idiomas y nuevas secciones */
.copto-language-switch{display:flex;align-items:center;gap:4px}
.copto-language-switch a{font-size:12px;font-weight:700;color:#fff;text-decoration:none;padding:7px 8px;border-radius:9px;opacity:.74}
.copto-language-switch a[aria-current="true"],.copto-language-switch a:hover{opacity:1;background:rgba(255,255,255,.17)}
.copto-service-symbol{font-size:42px;line-height:1;min-height:var(--copto-icon-size);display:grid;place-items:center}
.copto-lang-ar .copto-news-card,.copto-lang-ar .copto-content-card{text-align:right}
.copto-lang-ar .copto-home-search button{right:auto;left:5px}
.copto-lang-ar .copto-home-search input{padding-right:16px;padding-left:48px}
@media(max-width:390px){.copto-language-switch a{font-size:11px;padding:6px}.copto-topbar-inner{padding-inline:8px}.copto-brand-subtitle{display:none}}

/* V3.2: portada fotográfica adaptable, sin librerías externas. */
.copto-hero{
  position:relative;isolation:isolate;display:flex;align-items:center;overflow:hidden;
  min-height:var(--copto-hero-height);border-radius:25px;
  background:linear-gradient(125deg,#102e55 0%,#174d84 54%,#52769a 100%);
  box-shadow:0 15px 45px rgba(9,36,73,.17);
}
.copto-hero:before{content:"✝";position:absolute;inset:auto -15px -130px auto;font:400 470px/1 Georgia,serif;color:rgba(255,255,255,.045);pointer-events:none}
.copto-hero-slides,.copto-hero-slide,.copto-hero-shade{position:absolute;inset:0}
.copto-hero-slide{opacity:0;transition:opacity .8s ease;pointer-events:none}
.copto-hero-slide.is-active{opacity:1}
.copto-hero-image{display:block;width:100%;height:100%;object-fit:cover;object-position:center}
.copto-hero-shade{
  background:linear-gradient(90deg,rgba(4,21,42,.85) 0%,rgba(4,21,42,.49) 54%,rgba(4,21,42,.18) 100%),
             linear-gradient(0deg,rgba(4,21,42,var(--copto-hero-overlay)) 0%,transparent 62%);
  pointer-events:none;
}
.copto-hero-empty .copto-hero-shade{background:radial-gradient(circle at 78% 30%,rgba(180,143,83,.3),transparent 42%),linear-gradient(105deg,rgba(4,21,42,.28),transparent)}
html[dir="rtl"] .copto-hero-has-images .copto-hero-shade{background:linear-gradient(270deg,rgba(4,21,42,.85) 0%,rgba(4,21,42,.49) 54%,rgba(4,21,42,.18) 100%),linear-gradient(0deg,rgba(4,21,42,var(--copto-hero-overlay)),transparent 62%)}
.copto-hero-content{position:relative;z-index:2;color:white;max-width:760px;padding:70px clamp(23px,6vw,86px) 91px;text-align:start}
.copto-hero-eyebrow{display:inline-block;font-size:12px;letter-spacing:2.2px;font-weight:750;color:#f5dbac;margin-bottom:16px}
.copto-hero-content h1{color:white;font:700 clamp(34px,5.2vw,63px)/1.06 Georgia,"Times New Roman",serif;letter-spacing:-.5px;margin:0 0 18px;text-wrap:balance;text-shadow:0 3px 18px rgba(0,0,0,.18)}
.copto-hero-content p{font-size:clamp(15px,1.7vw,19px);line-height:1.6;max-width:590px;margin:0 0 27px;opacity:.96}
.copto-hero-link{display:inline-flex;align-items:center;gap:13px;background:#fff;color:#113d68;text-decoration:none;border-radius:30px;padding:12px 22px;font-weight:750;font-size:13px;box-shadow:0 5px 20px rgba(0,0,0,.12);transition:transform .2s ease,background .2s ease}
.copto-hero-link:hover,.copto-hero-link:focus-visible{background:#f9eace;transform:translateY(-2px);outline:3px solid #d7b67b;outline-offset:2px}
.copto-hero-link span{font-size:18px;line-height:1}
.copto-hero-controls{position:absolute;z-index:4;inset:auto 26px 32px auto;display:flex;align-items:center;gap:9px;direction:ltr}
.copto-hero-arrow,.copto-hero-pause{display:grid;place-items:center;border:1px solid rgba(255,255,255,.42);background:rgba(5,19,34,.32);backdrop-filter:blur(8px);color:white;border-radius:50%;width:37px;height:37px;line-height:1}
.copto-hero-arrow{font-size:29px;padding-bottom:4px}.copto-hero-pause{font-size:12px}
.copto-hero-arrow:hover,.copto-hero-pause:hover,.copto-hero-arrow:focus-visible,.copto-hero-pause:focus-visible{background:rgba(255,255,255,.28);outline:2px solid white;outline-offset:2px}
.copto-hero-dots{display:flex;align-items:center;justify-content:center;gap:6px}
.copto-hero-dots button{border:0;background:rgba(255,255,255,.56);border-radius:20px;width:8px;height:8px;padding:0;transition:width .2s,background .2s}
.copto-hero-dots button.is-active{width:26px;background:#fff}
.copto-hero-dots button:focus-visible{outline:2px solid white;outline-offset:4px}
.copto-home-search-overlap{z-index:5;margin:-25px auto 27px;padding:0 8px}
.copto-home-search-overlap input{background:#fff;color:#1f2933;border:1px solid #e5e9ee;min-height:54px;border-radius:17px;box-shadow:0 10px 25px rgba(7,34,69,.13)}
.copto-home-search-overlap button{top:7px;right:15px}
.copto-services-title{justify-content:center;margin:0 0 12px}
.copto-services-title h2{font-size:clamp(21px,3vw,27px);text-align:center}
.copto-service-copy{display:flex;flex-direction:column;align-items:center;min-width:0}
.copto-service-card{border-color:#e8edf3;box-shadow:0 5px 18px rgba(10,35,60,.055)}
.copto-service-icon{border-radius:18px}
.copto-news{margin-top:44px}
.copto-news .copto-section-head{margin-bottom:16px}
.copto-news-card{transition:box-shadow .2s ease,transform .2s ease}
.copto-news-card:hover,.copto-news-card:focus-visible{transform:translateY(-2px);box-shadow:0 13px 32px rgba(10,35,60,.12)}
body.copto-dark .copto-service-card{border-color:var(--copto-line)}

@media(min-width:760px){
  .copto-service-card{min-height:126px;flex-direction:row;text-align:start;justify-content:flex-start;gap:18px;padding:16px 22px}
  .copto-service-icon{flex:0 0 var(--copto-icon-size);margin-bottom:0}
  .copto-service-copy{align-items:flex-start}
  .copto-service-card strong{font-size:19px}
  .copto-service-card small{font-size:12px}
}
@media(max-width:599px){
  .copto-main{padding-top:12px}
  .copto-hero{border-radius:19px;min-height:430px}
  .copto-hero-content{padding:40px 24px 108px}
  .copto-hero-content h1{font-size:clamp(32px,9vw,45px)}
  .copto-hero-content p{font-size:14px}
  .copto-hero-controls{right:15px;bottom:38px;gap:8px}
  .copto-hero-arrow,.copto-hero-pause{width:34px;height:34px}
  .copto-home-search-overlap{margin-bottom:26px}
  .copto-home-search-overlap button{right:13px}
  .copto-service-card{min-height:145px}
}
@media(max-width:380px){.copto-hero-content{padding-inline:19px}.copto-hero-controls{right:11px}.copto-hero-dots{gap:4px}.copto-hero-link{padding:10px 15px}}
@media(prefers-reduced-motion:reduce){.copto-hero-slide,.copto-hero-link,.copto-hero-dots button,.copto-news-card{transition:none}}
