/*
Theme Name: The Solar Explorer (Modern)
Theme URI: https://newthesolarexplorer.qsplace.co.uk
Author: Rebuild of Andy Devey's original
Description: A clean, modern, responsive WordPress block theme for The Solar Explorer. Warm amber accent, editorial serif headings, dark/light mode, an image lightbox, click-to-load animation GIFs, scroll reveal, a feature-card landing page, SEO/Open Graph tags and a sun favicon. Same content as the classic replica, presented for today's screens.
Version: 1.1.0
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: solarexplorer-modern
*/

/* Block themes are driven by theme.json. WordPress does NOT auto-enqueue a
   block theme's style.css on the front end, so functions.php enqueues it.
   This file carries the extras theme.json cannot express: the sticky header
   shadow, the gradient hero, the nav hover underline, and image cards. */

:root {
  --se-accent: #f59e0b;
  --se-accent-dark: #b45309;
  --se-ink: #1c1917;
  --se-heading: #0f172a;
  --se-muted: #78716c;
  --se-line: #e7e5e4;
}

/* ---- Header / navigation -------------------------------------------------- */
.se-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--se-line);
}

/* Site title with a small amber "sun" glyph */
.se-brand .wp-block-site-title a {
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--se-heading);
}
.se-brand .wp-block-site-title a:hover { color: var(--se-accent-dark); }
.se-sun {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fde68a 0%, #f59e0b 55%, #d97706 100%);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18), 0 0 14px rgba(245, 158, 11, 0.55);
  vertical-align: -3px;
}

/* Top nav items: quiet by default, amber underline on hover / current */
.se-nav .wp-block-navigation-item__content {
  font-weight: 500;
  color: var(--se-ink);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  transition: color .15s ease, border-color .15s ease;
}
.se-nav .wp-block-navigation-item__content:hover,
.se-nav .current-menu-item > .wp-block-navigation-item__content {
  color: var(--se-accent-dark);
  border-bottom-color: var(--se-accent);
}
.se-nav .wp-block-navigation__submenu-container {
  border: 1px solid var(--se-line);
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.14);
  padding: 6px;
  min-width: 240px;
}
.se-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
  border-radius: 8px;
  border-bottom: 0;
  padding: 8px 12px;
}
.se-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
  background: #fff7ed;
  color: var(--se-accent-dark);
}

/* ---- Hero (front page) ---------------------------------------------------- */
.se-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 460px at 82% -20%, rgba(245, 158, 11, 0.45) 0%, rgba(245, 158, 11, 0) 60%),
    linear-gradient(135deg, #0b1020 0%, #131a33 45%, #241033 100%);
  color: #f8fafc;
}
.se-hero::after {
  content: "";
  position: absolute;
  top: -120px; right: -80px;
  width: 340px; height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #fef3c7 0%, #fbbf24 42%, #f59e0b 66%, rgba(217,119,6,0) 72%);
  filter: blur(2px);
  opacity: 0.9;
  pointer-events: none;
}
.se-hero .se-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 13px;
  font-weight: 600;
  color: #fbbf24;
  margin: 0 0 10px;
}
.se-hero h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 14px;
}
.se-hero .se-tagline {
  font-size: clamp(1.05rem, 1rem + 0.6vw, 1.4rem);
  color: #cbd5e1;
  max-width: 34ch;
  margin: 0 0 26px;
}
.se-btn a,
a.se-btn {
  display: inline-block;
  background: var(--se-accent);
  color: #1c1917 !important;
  font-weight: 600;
  text-decoration: none !important;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.se-btn a:hover,
a.se-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(245, 158, 11, 0.45); }

/* ---- Typography & content ------------------------------------------------- */
.wp-block-post-title,
.entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.01em;
}
.se-page-title {
  position: relative;
  padding-bottom: 14px;
  margin-bottom: 8px;
}
.se-page-title::after {
  content: "";
  display: block;
  position: absolute;
  left: 0; bottom: 0;
  width: 64px; height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.se-meta { color: var(--se-muted); font-size: 14px; }

/* Content links */
.wp-block-post-content a,
.entry-content a { color: var(--se-accent-dark); text-underline-offset: 2px; }
.wp-block-post-content a:hover,
.entry-content a:hover { color: var(--se-accent); }

/* Images become soft cards; keep old inline sheets from overflowing */
.wp-block-post-content img,
.entry-content img { max-width: 100%; height: auto; }
.wp-block-post-content figure img,
.wp-block-post-content p > img,
.entry-content figure img {
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.10);
}

/* Gallery images as a responsive grid of cards */
.wp-block-gallery img { border-radius: 12px; }

/* ---- Footer --------------------------------------------------------------- */
.se-footer {
  background: linear-gradient(135deg, #0b1020 0%, #1a1230 100%);
  color: #cbd5e1;
}
.se-footer a { color: #fbbf24; }
.se-footer .se-footer-brand {
  font-family: Georgia, "Times New Roman", serif;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

/* ---- Responsive tweaks ---------------------------------------------------- */
@media (max-width: 781px) {
  .se-hero { text-align: left; }
  .se-brand { row-gap: 8px; }
}

/* ==========================================================================
   Modernisation layer (added in the enhancements pass)
   ========================================================================== */

/* ---- Dark / light theme --------------------------------------------------- */
/* Flip by remapping the theme.json preset variables + local vars. A saved
   choice wins; otherwise app.js seeds data-theme from prefers-color-scheme. */
:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --wp--preset--color--base: #0b1020;
  --wp--preset--color--contrast: #e5e7eb;
  --wp--preset--color--heading: #f8fafc;
  --wp--preset--color--surface: #141a2e;
  --wp--preset--color--secondary: #fbbf24;   /* links readable on dark */
  --se-ink: #e5e7eb;
  --se-heading: #f8fafc;
  --se-muted: #9aa3b2;
  --se-line: #26304a;
}
:root[data-theme="dark"] body { background: #0b1020; color: #e5e7eb; }
:root[data-theme="dark"] .se-header {
  background: rgba(11, 16, 32, 0.86);
  border-bottom-color: #26304a;
}
:root[data-theme="dark"] .se-nav .wp-block-navigation-item__content { color: #e5e7eb; }
:root[data-theme="dark"] .se-nav .wp-block-navigation__submenu-container {
  background: #141a2e; border-color: #26304a;
}
:root[data-theme="dark"] .se-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
  background: #1e2540; color: #fde68a;
}
:root[data-theme="dark"] .se-brand .wp-block-site-title a { color: #f8fafc; }
:root[data-theme="dark"] .se-card { background: #141a2e; border-color: #26304a; }
:root[data-theme="dark"] .wp-block-post-content figure img,
:root[data-theme="dark"] .entry-content figure img,
:root[data-theme="dark"] .wp-block-post-content p > img { box-shadow: 0 6px 20px rgba(0,0,0,0.5); }
:root[data-theme="dark"] .se-links-list li { border-bottom-color: #26304a; }

/* ---- Theme toggle button -------------------------------------------------- */
.se-theme-toggle {
  border: 1px solid var(--se-line);
  background: transparent;
  color: var(--se-ink);
  width: 40px; height: 40px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 17px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.se-theme-toggle:hover { border-color: var(--se-accent); transform: rotate(-12deg); }
.se-theme-toggle .se-icon-sun { display: none; }
.se-theme-toggle .se-icon-moon { display: inline; }
:root[data-theme="dark"] .se-theme-toggle .se-icon-sun { display: inline; }
:root[data-theme="dark"] .se-theme-toggle .se-icon-moon { display: none; }

/* ---- Reading-progress bar ------------------------------------------------- */
.se-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200;
  background: transparent; pointer-events: none;
}
.se-progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  transition: width .1s linear;
}
.se-header.is-scrolled { box-shadow: 0 6px 24px rgba(15, 23, 42, 0.10); }

/* ---- Back to top ---------------------------------------------------------- */
.se-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 150;
  width: 46px; height: 46px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--se-accent); color: #1c1917; font-size: 20px;
  box-shadow: 0 10px 26px rgba(245, 158, 11, 0.4);
  opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.se-top.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.se-top:hover { transform: translateY(-2px); }

/* ---- Scroll reveal -------------------------------------------------------- */
.se-reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.se-reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .se-reveal { opacity: 1; transform: none; transition: none; }
}

/* ---- Deferred animation GIFs (click to load) ------------------------------ */
.se-gif { display: inline-block; position: relative; max-width: 100%; }
.se-gif.is-idle img { filter: grayscale(0.35) brightness(0.8); }
.se-gif-load {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  border: 0; cursor: pointer; border-radius: 999px;
  background: rgba(17, 24, 39, 0.82); color: #fff; font-weight: 600; font-size: 15px;
  padding: 10px 18px; backdrop-filter: blur(2px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.35);
}
.se-gif-load:hover { background: var(--se-accent); color: #1c1917; }
.se-gif-play { margin-right: 4px; }

/* ---- Lightbox ------------------------------------------------------------- */
.se-lightbox {
  position: fixed; inset: 0; z-index: 300; display: none;
  align-items: center; justify-content: center;
  background: rgba(6, 8, 16, 0.92); padding: 24px;
  opacity: 0; transition: opacity .18s ease;
}
.se-lightbox.is-open { display: flex; opacity: 1; }
.se-lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.se-lb-close {
  position: absolute; top: 18px; right: 22px; width: 44px; height: 44px;
  border-radius: 999px; border: 0; cursor: pointer; font-size: 20px;
  background: rgba(255,255,255,.12); color: #fff;
}
.se-lb-close:hover { background: var(--se-accent); color: #1c1917; }
.wp-block-post-content img, .entry-content img, .wp-block-gallery img { cursor: zoom-in; }

/* ---- Feature-card landing grid -------------------------------------------- */
.se-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; margin: 8px 0;
}
.se-card {
  display: block; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid var(--se-line); border-radius: 16px;
  padding: 22px 22px 20px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.se-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(15,23,42,.12); border-color: var(--se-accent); }
.se-card .se-card-ico { font-size: 26px; line-height: 1; margin-bottom: 12px; display: block; }
.se-card h3 { font-family: Georgia, serif; margin: 0 0 6px; font-size: 1.2rem; color: var(--se-heading); }
.se-card p { margin: 0; color: var(--se-muted); font-size: 15px; }
.se-section-label {
  text-transform: uppercase; letter-spacing: .18em; font-size: 13px; font-weight: 600;
  color: var(--se-accent-dark); margin: 0 0 6px;
}

/* Web Links page: tidy list */
.se-links-list { list-style: none; margin: 0; padding: 0; }
.se-links-list li { padding: 10px 0; border-bottom: 1px solid var(--se-line); }

/* ---- Richer footer -------------------------------------------------------- */
.se-footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px; align-items: start; text-align: left;
}
.se-footer-grid h4 { color: #fff; font-family: Georgia, serif; font-size: 16px; margin: 0 0 10px; }
.se-footer-grid ul { list-style: none; margin: 0; padding: 0; }
.se-footer-grid li { margin: 4px 0; font-size: 15px; }

/* ---- Accessibility -------------------------------------------------------- */
.se-skip {
  position: absolute; left: -9999px; top: 0; z-index: 400;
  background: var(--se-accent); color: #1c1917; padding: 10px 16px; border-radius: 0 0 8px 0;
  font-weight: 600;
}
.se-skip:focus { left: 0; }
a:focus-visible, button:focus-visible, .wp-block-navigation-item__content:focus-visible {
  outline: 3px solid var(--se-accent); outline-offset: 2px; border-radius: 4px;
}

/* ---- Print ---------------------------------------------------------------- */
@media print {
  .se-header, .se-footer, .se-top, .se-progress, .se-theme-toggle, .se-gif-load { display: none !important; }
  body { color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
}

/* ---- Post archive (categories / blog) ------------------------------------- */
.se-archive-head { margin-bottom: 8px; }
.se-archive-head .se-section-label { margin-bottom: 4px; }
.se-post-grid.wp-block-post-template {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px;
}
.se-post-grid > li {
  background: #fff; border: 1px solid var(--se-line); border-radius: 16px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.se-post-grid > li:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(15,23,42,.12); border-color: var(--se-accent); }
.se-post-grid .wp-block-post-featured-image,
.se-post-grid .se-card-thumb { margin: 0; }
.se-post-grid .wp-block-post-title { font-size: 1.25rem; margin: 0 0 6px; padding: 18px 18px 0; }
.se-post-grid .wp-block-post-title a { text-decoration: none; color: var(--se-heading); }
.se-post-grid .wp-block-post-date { padding: 0 18px; color: var(--se-muted); font-size: 13px; }
.se-post-grid .wp-block-post-excerpt { padding: 6px 18px 18px; color: var(--se-ink); font-size: 15px; }
.se-post-grid .wp-block-post-excerpt__more-text a { color: var(--se-accent-dark); font-weight: 600; }
:root[data-theme="dark"] .se-post-grid > li { background: #141a2e; border-color: #26304a; }

/* category chips on single posts */
.se-terms a {
  display: inline-block; font-size: 13px; font-weight: 600;
  color: var(--se-accent-dark); background: #fff7ed; border: 1px solid #fed7aa;
  padding: 2px 10px; border-radius: 999px; text-decoration: none; margin-right: 6px;
}
:root[data-theme="dark"] .se-terms a { background: #2a1f0a; border-color: #5a3d0a; color: #fbbf24; }

/* Galleries landing: category tiles */
.se-galleries { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 20px; margin-top: 8px; }

/* ---- Table of contents (long pages) --------------------------------------- */
.se-toc {
  background: var(--wp--preset--color--surface, #f5f5f4);
  border: 1px solid var(--se-line); border-radius: 14px;
  padding: 16px 20px; margin: 0 0 28px;
}
.se-toc h2 { font-size: 15px !important; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 8px !important; color: var(--se-muted) !important; }
.se-toc ol { margin: 0; padding-left: 18px; }
.se-toc li { margin: 3px 0; }
.se-toc a { color: var(--se-accent-dark); text-decoration: none; }
.se-toc a:hover { text-decoration: underline; }
:root[data-theme="dark"] .se-toc { background: #141a2e; }

/* ---- Small-screen hero polish --------------------------------------------- */
@media (max-width: 600px) {
  .se-hero { padding-top: 64px !important; padding-bottom: 64px !important; }
  .se-hero h1 { font-size: clamp(2rem, 1.4rem + 6vw, 2.8rem) !important; }
  .se-hero::after { width: 190px; height: 190px; top: -70px; right: -50px; opacity: .7; }
  .se-hero .se-tagline { max-width: none; }
  .se-hero-cta .se-btn { flex: 1 1 auto; text-align: center; }
}
