/*
Theme Name: Karen Young for Queen Edith's
Theme URI: https://decipherable.ai/wpkaren
Author: Karen Young web team
Description: Liberal Democrat-inspired theme for Karen Young, Queen Edith's Ward — modern, dynamic, photo-led. Ported from the karenyoung-new custom site (animated hero, gold action bar, card grids, scroll-reveal, counters, lightbox).
Version: 1.0.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: karenyoung
*/
/* =========================================================================
   Karen Young for Queen Edith's Ward
   Liberal Democrat-inspired theme — modern, dynamic, photo-led
   ========================================================================= */

:root {
    --gold: #FAA61A;          /* Lib Dem gold */
    --gold-deep: #E8890B;
    --gold-soft: #FFF3DF;
    --ink: #15171c;
    --ink-soft: #3a3f4b;
    --muted: #6b7280;
    --line: #e9e6df;
    --bg: #ffffff;
    --bg-alt: #faf7f1;
    --accent: #0b4eb0;        /* Lib Dem blue accent for links/balance */
    --radius: 16px;
    --radius-lg: 26px;
    --shadow: 0 10px 30px rgba(20, 22, 30, .08);
    --shadow-lg: 0 26px 60px rgba(20, 22, 30, .18);
    --maxw: 1180px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --head: "Poppins", var(--font);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-deep); }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.15; font-weight: 700; color: var(--ink); margin: 0 0 .5em; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.section { padding: 72px 0; }
.section--alt { background: var(--bg-alt); }
.center { text-align: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; font-weight: 700; color: var(--gold-deep); }

/* ---------- scroll progress bar ---------- */
#progress {
    position: fixed; top: 0; left: 0; height: 4px; width: 0;
    background: linear-gradient(90deg, var(--gold), var(--gold-deep));
    z-index: 2000; transition: width .1s linear;
}

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: .5em;
    padding: .85em 1.5em; border-radius: 999px; font-weight: 700;
    font-family: var(--head); cursor: pointer; border: 2px solid transparent;
    transition: transform .18s, box-shadow .18s, background .18s, color .18s;
    font-size: .98rem; line-height: 1;
}
.btn--gold { background: var(--gold); color: var(--ink); box-shadow: 0 8px 20px rgba(250,166,26,.4); }
.btn--gold:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(250,166,26,.55); color: var(--ink); }
.btn--ghost { background: transparent; border-color: rgba(255,255,255,.7); color: #fff; }
.btn--ghost:hover { background: #fff; color: var(--ink); transform: translateY(-3px); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: var(--gold-deep); transform: translateY(-3px); color: #fff; }
.btn--sm { padding: .55em 1em; font-size: .85rem; }

/* ---------- top nav ---------- */
.nav {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(255,255,255,.86); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    transition: box-shadow .3s, background .3s;
}
.nav.scrolled { box-shadow: var(--shadow); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: .65rem; font-family: var(--head); font-weight: 800; font-size: 1.18rem; color: var(--ink); }
.brand .dot { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold-deep)); display: grid; place-items: center; color: #fff; font-weight: 800; box-shadow: 0 6px 16px rgba(250,166,26,.5); }
.brand small { display: block; font-size: .68rem; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.menu { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.menu a { color: var(--ink-soft); font-weight: 600; padding: .5rem .85rem; border-radius: 10px; position: relative; }
.menu a:hover, .menu a.active { color: var(--ink); background: var(--gold-soft); }
.menu a.active::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: 4px; height: 3px; border-radius: 3px; background: var(--gold); }
.nav__cta { display: flex; align-items: center; gap: .6rem; }
.nav__toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav__toggle span { display: block; width: 26px; height: 3px; background: var(--ink); border-radius: 3px; margin: 5px 0; transition: .3s; }

/* ---------- hero ---------- */
.hero {
    position: relative; color: #fff; overflow: hidden;
    background: radial-gradient(1200px 600px at 80% -10%, #ffce80 0%, transparent 60%),
                linear-gradient(135deg, #11203f 0%, #0b4eb0 55%, #1565d8 100%);
    padding: 92px 0 110px;
}
.hero::before {
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(circle at 20% 30%, rgba(250,166,26,.35), transparent 40%),
                      radial-gradient(circle at 90% 70%, rgba(250,166,26,.25), transparent 45%);
    animation: drift 16s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(0, -24px, 0) scale(1.06); } }
.hero__grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2.3rem, 5vw, 4rem); letter-spacing: -.02em; }
.hero h1 .accent { color: var(--gold); }
.hero p.lede { font-size: 1.2rem; color: rgba(255,255,255,.92); max-width: 36ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero__badges { display: flex; gap: 22px; margin-top: 34px; flex-wrap: wrap; }
.hero__badge { display: flex; align-items: center; gap: .55rem; font-weight: 600; font-size: .95rem; color: rgba(255,255,255,.9); }
.hero__badge b { font-family: var(--head); font-size: 1.5rem; color: var(--gold); }
.hero__photo { position: relative; }
.hero__photo .frame {
    border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg);
    border: 6px solid rgba(255,255,255,.18); aspect-ratio: 4/5; background: #0b4eb0;
    animation: floaty 6s ease-in-out infinite;
}
.hero__photo .frame img { width: 100%; height: 100%; object-fit: cover; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.hero__photo .rosette {
    position: absolute; bottom: -22px; left: -22px; width: 96px; height: 96px;
    background: radial-gradient(circle at 50% 40%, var(--gold), var(--gold-deep)); border-radius: 50%;
    display: grid; place-items: center; color: #fff; font-family: var(--head); font-weight: 800;
    text-align: center; font-size: .72rem; box-shadow: var(--shadow-lg); line-height: 1.1;
    border: 4px dashed rgba(255,255,255,.6); animation: spinslow 18s linear infinite;
}
@keyframes spinslow { to { transform: rotate(360deg); } }
.hero__wave { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 1; line-height: 0; }
.hero__wave svg { width: 100%; height: 90px; display: block; }

/* ---------- quick action strip ---------- */
.actionbar { background: var(--gold); }
.actionbar .container { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; }
.action { display: flex; align-items: center; gap: .7rem; color: var(--ink); font-weight: 700; font-family: var(--head); }
.action .ic { width: 40px; height: 40px; border-radius: 12px; background: rgba(0,0,0,.08); display: grid; place-items: center; font-size: 1.2rem; }
.action:hover { color: var(--ink); transform: translateY(-2px); transition: transform .2s; }

/* ---------- section heading ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 34px; flex-wrap: wrap; }
.sec-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: .15em 0 0; }
.sec-head .link { font-weight: 700; font-family: var(--head); }

/* ---------- cards / post grid ---------- */
.grid { display: grid; gap: 28px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.card {
    background: #fff; border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); border: 1px solid var(--line);
    display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.card__media { position: relative; aspect-ratio: 16/10; overflow: hidden; background: linear-gradient(135deg, #0b4eb0, #1565d8); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.card:hover .card__media img { transform: scale(1.08); }
.card__cat { position: absolute; top: 12px; left: 12px; background: var(--gold); color: var(--ink); font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; padding: .35em .75em; border-radius: 999px; font-family: var(--head); }
.card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.card__date { font-size: .8rem; color: var(--muted); font-weight: 600; }
.card__title { font-size: 1.18rem; margin: .35em 0 .5em; }
.card__title a { color: var(--ink); }
.card__title a:hover { color: var(--gold-deep); }
.card__excerpt { color: var(--ink-soft); font-size: .94rem; flex: 1; }
.card__more { margin-top: 14px; font-weight: 700; font-family: var(--head); color: var(--gold-deep); display: inline-flex; align-items: center; gap: .4em; }
.card__more .arrow { transition: transform .2s; }
.card:hover .card__more .arrow { transform: translateX(5px); }

/* feature card (big) */
.feature {
    display: grid; grid-template-columns: 1.1fr .9fr; background: #fff; border-radius: var(--radius-lg);
    overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.feature__media { position: relative; min-height: 340px; background: linear-gradient(135deg, #0b4eb0, #1565d8); overflow: hidden; }
.feature__media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.feature__body { padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.feature__body h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }

/* ---------- sidebar / split ---------- */
.split { display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: start; }
.widget { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 26px; }
.widget h3 { font-size: 1.1rem; display: flex; align-items: center; gap: .5rem; }
.widget h3::before { content: ""; width: 10px; height: 22px; border-radius: 4px; background: var(--gold); display: inline-block; }
.mini { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mini:last-child { border-bottom: 0; }
.mini img { width: 70px; height: 70px; border-radius: 12px; object-fit: cover; flex: none; background: var(--gold-soft); }
.mini b { font-size: .92rem; font-family: var(--head); }
.mini a { color: var(--ink); }
.mini a:hover { color: var(--gold-deep); }
.mini span { font-size: .76rem; color: var(--muted); }

/* search box */
.searchbox { display: flex; gap: 8px; }
.searchbox input { flex: 1; padding: .7em .9em; border: 1px solid var(--line); border-radius: 10px; font-size: .95rem; }
.searchbox input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }

/* ---------- stats counter band ---------- */
.statsband { background: linear-gradient(135deg, #11203f, #0b4eb0); color: #fff; }
.statsband .grid { grid-template-columns: repeat(4, 1fr); text-align: center; gap: 20px; }
.stat b { font-family: var(--head); font-size: clamp(2rem, 4vw, 3rem); color: var(--gold); display: block; }
.stat span { color: rgba(255,255,255,.85); font-weight: 600; }

/* ---------- single post ---------- */
.post-hero { position: relative; color: #fff; padding: 80px 0 64px; background: linear-gradient(135deg, #11203f, #0b4eb0); overflow: hidden; }
.post-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(800px 400px at 80% 0%, rgba(250,166,26,.4), transparent 60%); }
.post-hero .container { position: relative; z-index: 2; }
.post-hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 3rem); max-width: 22ch; }
.post-meta { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; color: rgba(255,255,255,.85); font-weight: 600; font-size: .92rem; margin-top: 10px; }
.pill { background: var(--gold); color: var(--ink); padding: .3em .8em; border-radius: 999px; font-weight: 800; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; font-family: var(--head); }
.article { font-size: 1.08rem; color: var(--ink-soft); }
.article p { margin: 0 0 1.2em; }
.article h2, .article h3 { color: var(--ink); margin-top: 1.4em; }
.article img, .article figure img { border-radius: var(--radius); box-shadow: var(--shadow); margin: 1.2em auto; cursor: zoom-in; }
.article figure { margin: 1.4em 0; }
.article figcaption { text-align: center; color: var(--muted); font-size: .86rem; margin-top: .5em; }
.article ul, .article ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.article a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(11,78,176,.3); }
.article blockquote { border-left: 4px solid var(--gold); margin: 1.4em 0; padding: .6em 1.2em; background: var(--gold-soft); border-radius: 0 12px 12px 0; font-style: italic; }
.share { display: flex; gap: 10px; align-items: center; margin: 30px 0; flex-wrap: wrap; }
.share a { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-alt); border: 1px solid var(--line); color: var(--ink); font-weight: 700; }
.share a:hover { background: var(--gold); transform: translateY(-3px); transition: .2s; }

/* prev/next */
.adjacent { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 40px 0; }
.adjacent a { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow); }
.adjacent a:hover { border-color: var(--gold); transform: translateY(-4px); transition: .2s; }
.adjacent small { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: .72rem; }
.adjacent b { display: block; font-family: var(--head); color: var(--ink); margin-top: 4px; }
.adjacent .nx { text-align: right; }

/* comments */
.comment { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow); }
.comment .who { font-weight: 700; font-family: var(--head); }
.comment .when { color: var(--muted); font-size: .8rem; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: #fff; display: grid; place-items: center; font-weight: 800; font-family: var(--head); flex: none; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 5px; font-size: .9rem; }
.form-row input, .form-row textarea, .form-row select { width: 100%; padding: .75em .9em; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; font-family: var(--font); }
.form-row input:focus, .form-row textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.hp { position: absolute; left: -9999px; top: -9999px; }
.notice { padding: .9em 1.1em; border-radius: 12px; margin-bottom: 16px; font-weight: 600; }
.notice--ok { background: #e6f9ed; color: #176b3a; border: 1px solid #9be0b4; }
.notice--err { background: #ffe3e3; color: #9b1c1c; border: 1px solid #ffb3b3; }

/* ---------- pagination ---------- */
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 44px; flex-wrap: wrap; }
.pager a, .pager span { padding: .6em .95em; border-radius: 10px; border: 1px solid var(--line); font-weight: 700; font-family: var(--head); color: var(--ink); background: #fff; }
.pager a:hover { background: var(--gold-soft); border-color: var(--gold); }
.pager .cur { background: var(--gold); border-color: var(--gold); color: var(--ink); }

/* ---------- footer ---------- */
.footer { background: var(--ink); color: rgba(255,255,255,.8); padding: 64px 0 30px; }
.footer h4 { color: #fff; font-size: 1.05rem; }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 36px; }
.footer a { color: rgba(255,255,255,.78); }
.footer a:hover { color: var(--gold); }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 10px; }
.footer .brand { color: #fff; }
.footer .brand small { color: rgba(255,255,255,.6); }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 40px; padding-top: 22px; font-size: .85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.socials { display: flex; gap: 10px; }
.socials a { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.08); display: grid; place-items: center; color: #fff; }
.socials a:hover { background: var(--gold); transform: translateY(-3px); transition: .2s; }

/* ---------- reveal animation fallback (if AOS not loaded) ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
    .hero__grid { grid-template-columns: 1fr; }
    .hero__photo { max-width: 360px; margin: 0 auto; }
    .feature, .split { grid-template-columns: 1fr; }
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
    .footer__grid { grid-template-columns: 1fr 1fr; }
    .statsband .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .menu { position: fixed; inset: 72px 0 auto 0; flex-direction: column; background: #fff; padding: 12px 22px 22px; box-shadow: var(--shadow); transform: translateY(-120%); transition: transform .3s; gap: 2px; }
    .menu.open { transform: none; }
    .menu a { display: block; padding: .8rem .6rem; }
    .nav__toggle { display: block; }
    .nav__cta .btn--gold { display: none; }
    .grid--3, .grid--2 { grid-template-columns: 1fr; }
    .adjacent { grid-template-columns: 1fr; }
    .footer__grid { grid-template-columns: 1fr; }
    .section { padding: 52px 0; }
    .actionbar .container { justify-content: flex-start; }
}

/* Embedded and self-hosted video in post content */
.post__content .video-embed,.article .video-embed,.video-embed{position:relative;padding-bottom:56.25%;height:0;margin:20px 0;overflow:hidden}
.video-embed iframe{position:absolute;inset:0;width:100%;height:100%;border:0;border-radius:12px}
.post__content video,.article video,article video{max-width:100%;height:auto;border-radius:12px;margin:16px 0;background:#000}

/* =========================================================================
   WordPress core compatibility additions
   ========================================================================= */
.article .aligncenter, .article img.aligncenter { margin-left: auto; margin-right: auto; }
.article .alignleft { float: left; margin: .4em 1.2em 1em 0; }
.article .alignright { float: right; margin: .4em 0 1em 1.2em; }
.article .wp-caption { max-width: 100%; margin: 1.4em auto; }
.article .wp-caption-text, .article .wp-element-caption { text-align: center; color: var(--muted); font-size: .86rem; margin-top: .5em; }
.article .wp-block-image img { border-radius: var(--radius); box-shadow: var(--shadow); }
.article .wp-block-embed { margin: 20px 0; }
.article .wp-block-embed__wrapper { position: relative; }
.article .wp-block-embed iframe { max-width: 100%; border: 0; border-radius: 12px; }
.article .wp-block-embed-youtube .wp-block-embed__wrapper,
.article .wp-block-embed-vimeo .wp-block-embed__wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.article .wp-block-embed-youtube iframe, .article .wp-block-embed-vimeo iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }
.pager .dots { border: 0; background: none; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list .children { list-style: none; padding-left: 28px; }
.logged-in-as, .comment-notes { color: var(--muted); font-size: .88rem; }
.comment-reply-link { font-size: .82rem; font-weight: 700; }
.sticky, .bypostauthor, .gallery-caption, .alignwide, .alignfull { /* core-required classes */ }
