:root {
  --bg: #f6f7f9; --surface: #fff; --text: #1f2430; --muted: #6b7280;
  --accent: #0f766e; --accent-d: #0b5a54; --border: #e5e7eb;
  --radius: 12px; --shadow: 0 2px 10px rgba(16,24,40,.07);
  --max: 1200px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-d); text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.btn { display: inline-block; background: var(--btn-bg, var(--accent)); color: var(--btn-fg, #fff) !important; padding: .55em 1.1em; border-radius: 999px; font-weight: 600; text-decoration: none !important; border: 0; cursor: pointer; }
.btn:hover { background: var(--btn-hover, var(--accent-d)); }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: flex; flex-direction: column; line-height: 1.2; color: var(--text); text-decoration: none !important; }
.brand strong { font-size: 1.3rem; }
.brand span { font-size: .8rem; color: var(--muted); }
.main-nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.main-nav a { color: var(--text); font-weight: 500; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; font-size: 1.3rem; padding: 4px 10px; cursor: pointer; }

/* Hero slider */
.hero { position: relative; width: 100%; height: var(--hero-h, clamp(260px, 42vw, 480px)); overflow: hidden; background: #111; }
.slider-track { display: flex; height: 100%; transition: transform .6s cubic-bezier(.4,0,.2,1); will-change: transform; }
.slide { flex: 0 0 100%; height: 100%; background-size: var(--hero-fit, cover); background-repeat: no-repeat; background-color: #111; background-position: center; position: relative; }
.slide-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; padding: 0 max(20px, calc((100% - var(--max)) / 2 + 20px)); color: #fff; background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,0) 70%); }
.slide-overlay h2 { font-size: clamp(1.5rem, 4vw, 2.8rem); max-width: 18ch; margin: 0; }
.slide-overlay p { max-width: 46ch; font-size: clamp(1rem, 1.6vw, 1.2rem); margin: 0 0 10px; }
.slider-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.85); color: #111; font-size: 1.1rem; cursor: pointer; z-index: 2; }
.slider-arrow:hover { background: #fff; }
.slider-arrow.prev { left: 14px; } .slider-arrow.next { right: 14px; }
.slider-dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.slider-dots button { width: 11px; height: 11px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.5); cursor: pointer; }
.slider-dots button.active { background: #fff; transform: scale(1.25); }

/* Layouts */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 32px; padding-bottom: 48px; }
.full-width { padding-top: 32px; padding-bottom: 48px; }
.page { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 48px); }
.page-heading { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }

/* Widgets */
.widget { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 20px; }
.widget-title { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; padding-bottom: 8px; border-bottom: 2px solid var(--accent); }
.widget p:last-child { margin-bottom: 0; }
.widget-list { list-style: none; margin: 0; padding: 0; }
.widget-list li { padding: 7px 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; }
.widget-list li:last-child { border-bottom: 0; }
.widget-list small { color: var(--muted); width: 100%; }
.count { background: var(--bg); border-radius: 999px; padding: 0 9px; font-size: .8rem; color: var(--muted); }
.search-form { display: flex; gap: 6px; }
.search-form input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.search-form button { padding: 0 14px; border: 0; background: var(--btn-bg, var(--accent)); color: var(--btn-fg, #fff); border-radius: 8px; cursor: pointer; font-weight: 600; }

/* Levels */
.level { margin-bottom: 40px; }
.level-label { font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.level-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(16,24,40,.12); }
.card-img img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { margin: 0; }
.card-title a { color: var(--text); }
.excerpt { color: #4b5563; margin: 4px 0 8px; }
.meta { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.cat { font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: .72rem; }
.card-featured .card-img img { aspect-ratio: 21/9; }
.card-featured .card-title { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.card-featured .card-body { padding: 24px 28px 28px; align-items: flex-start; }
.card-featured .excerpt { font-size: 1.1rem; }
.card-medium .card-title { font-size: 1.3rem; }
.card-small .card-title { font-size: 1.05rem; }
.card-small .excerpt { font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.headlines { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.headlines li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.headlines li:last-child { border-bottom: 0; }
.headlines a:first-child { font-weight: 600; color: var(--text); }

/* Single post */
.post { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 44px); }
.post-header h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-top: 8px; }
.post-image { width: 100%; border-radius: var(--radius); margin: 16px 0 24px; aspect-ratio: 16/8; object-fit: cover; }
.post-content { font-size: 1.08rem; max-width: 72ch; }
.full-width .post-content { max-width: none; }
.post-content code { background: var(--bg); padding: 2px 6px; border-radius: 4px; }
.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); font-size: .95rem; }

/* Footer */
.site-footer { background: #111827; color: #d1d5db; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.site-footer .widget { background: transparent; box-shadow: none; padding: 0; margin: 0; }
.site-footer .widget-title { color: #fff; }
.site-footer a { color: #9ae6df; }
.site-footer .widget-list li { border-color: #374151; }
.site-footer .count { background: #1f2937; }
.footer-widgets { padding-top: 40px; padding-bottom: 20px; }
.footer-widgets .footer-grid { padding-top: 0; padding-bottom: 0; }
.footer-copyright { background: rgba(0,0,0,.28); border-top: 1px solid rgba(255,255,255,.08); padding: 16px 0 20px; font-size: .85rem; color: #9ca3af; }
.footer-copyright p { margin: 0; }
.footer-widgets.custom-fg a, .footer-widgets.custom-fg .widget-title, .footer-copyright.custom-fg a { color: inherit; }

/* Responsive */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-col:empty { display: none; }
}
@media (max-width: 680px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 20px 14px; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 10px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .headlines li { flex-direction: column; gap: 2px; }
  .slider-arrow { width: 36px; height: 36px; }
  .post-nav { flex-direction: column; }
}

/* Comments */
.comments{background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);padding:clamp(20px,4vw,36px);margin-top:24px}
.comment-list{list-style:none;margin:0 0 24px;padding:0}
.comment-list li{display:flex;gap:14px;padding:14px 0;border-bottom:1px solid var(--border)}
.comment-list .avatar{width:40px;height:40px;border-radius:50%;flex:none}
.comment-list p{margin:4px 0 0}.comment-list small{color:var(--muted)}
.comment-form label{display:block;font-weight:600;font-size:.9rem}
.comment-form input,.comment-form textarea{width:100%;padding:9px 12px;border:1px solid var(--border);border-radius:8px;font:inherit;margin-top:4px}
.comment-form .two{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.comment-form .hp{position:absolute;left:-9999px;height:0;overflow:hidden}
.comment-note{background:#d1fae5;color:#065f46;padding:10px 14px;border-radius:8px}
.comment-error{background:#fee2e2;color:#991b1b;padding:10px 14px;border-radius:8px}
.reading-time{color:var(--muted);font-size:.9rem;margin:0 0 12px}
@media(max-width:680px){.comment-form .two{grid-template-columns:1fr}}

/* Optional right sidebar */

/* Layout columns depend on which sidebars are enabled */
.layout.has-left { grid-template-columns: 280px minmax(0, 1fr); }
.layout.has-right { grid-template-columns: minmax(0, 1fr) 260px; }
.layout.has-left.has-right { grid-template-columns: 260px minmax(0, 1fr) 260px; }
@media (max-width: 1100px) { .layout.has-left.has-right { grid-template-columns: 260px minmax(0, 1fr); } .layout.has-left.has-right .sidebar-right { grid-column: 1 / -1; } }
@media (max-width: 960px) { .layout.has-left, .layout.has-right, .layout.has-left.has-right { grid-template-columns: 1fr; } }

/* Pages and posts fill their column (sidebar layouts included) */
.layout .page .post-content, .layout .content .post-content { max-width: none; }

/* Sidebar content must fit its column and never be clipped */
.sidebar { min-width: 0; align-self: start; }
.sidebar .widget { overflow: visible; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.sidebar .widget img, .sidebar .widget video, .sidebar .widget iframe, .sidebar .widget embed, .sidebar .widget object, .sidebar .widget canvas, .sidebar .widget svg { max-width: 100%; height: auto; }
.sidebar .widget iframe { height: auto; aspect-ratio: 16 / 9; }
.sidebar .widget table { display: block; max-width: 100%; overflow-x: auto; }
.sidebar .widget pre, .sidebar .widget code { white-space: pre-wrap; max-width: 100%; }
.sidebar .widget input, .sidebar .widget select, .sidebar .widget textarea { max-width: 100%; box-sizing: border-box; }

/* Logo */
.brand.has-logo { flex-direction: row; align-items: center; gap: 12px; }
.brand .logo { max-height: 44px; width: auto; max-width: 200px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand .brand-text { font-size: 1rem; color: var(--text); }
.cat-desc { color: var(--muted); margin: -4px 0 20px; max-width: 70ch; }
.page-full .full-width .post-content, .layout.no-sidebar .page .post-content { max-width: none; }

/* Header colour options: text colour applies to brand, tagline and menu */
.site-header.custom-fg .brand, .site-header.custom-fg .brand strong, .site-header.custom-fg .brand-text, .site-header.custom-fg .main-nav a, .site-header.custom-fg .nav-toggle { color: inherit; }
.site-header.custom-fg .brand span { color: inherit; opacity: .72; }
.site-header.custom-fg .nav-toggle { border-color: currentColor; background: transparent; }
.site-header.custom-fg .main-nav { background: inherit; }

/* Social links widget */
.social-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.social-links a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: #fff !important;
  font-weight: 700; font-size: .85rem; text-decoration: none !important; transition: transform .15s, opacity .15s; }
.social-links a:hover { transform: translateY(-2px); opacity: .88; }
.social-links.as-list { flex-direction: column; gap: 6px; }
.social-links.as-list a { width: auto; height: auto; border-radius: 0; background: none !important; color: var(--accent) !important; justify-content: flex-start; font-weight: 500; font-size: 1rem; }
.site-footer .social-links.as-list a { color: inherit !important; }

/* Accounts */
.account-wrap { padding-top: 40px; padding-bottom: 60px; }
.account-box { max-width: 1040px; margin: 0 auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.account-box h1 { font-size: 1.6rem; }
.account-alt { margin: 16px 0 0; color: var(--muted); font-size: .95rem; }
.nav-account a { font-weight: 600; }
.comment-as { background: var(--bg); border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; }

/* Homepage category sections */
.home-section .level-label a:first-child { color: var(--text); text-decoration: none; }
.home-section .see-all { order: 3; font-size: .8rem; text-transform: none; letter-spacing: 0; font-weight: 600; white-space: nowrap; }
.card-ph { display: block; width: 100%; aspect-ratio: 16/9; background: linear-gradient(135deg, var(--accent), var(--accent-d)); opacity: .85; }
.single .post-image[src=""] { display: none; }

/* Account dropdown in the header */
.nav-dropdown { position: relative; }
.dd-toggle { background: none; border: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 4px; }
.main-nav a, .dd-toggle { color: var(--hdr-fg, var(--text)); }
.site-header.custom-fg .dd-toggle { color: inherit; }
.dd-toggle:hover { color: var(--accent); }
.dd-toggle .caret { font-size: .7em; transition: transform .15s; }
.nav-dropdown.open .caret { transform: rotate(180deg); }
.dd-menu { display: none; position: absolute; right: 0; top: calc(100% + 10px); min-width: 180px; list-style: none; margin: 0; padding: 6px 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 28px rgba(16,24,40,.16); z-index: 60; }
.nav-dropdown.open .dd-menu { display: block; }
.main-nav .dd-menu { flex-direction: column; gap: 0; }
.dd-menu li { display: block; }
.dd-menu a, .dd-menu button { display: block; width: 100%; text-align: left; padding: 9px 16px; background: none; border: 0; font: inherit; font-weight: 500; color: var(--text) !important; cursor: pointer; text-decoration: none; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--bg); color: var(--accent) !important; text-decoration: none; }
.dd-menu form { margin: 0; }
.site-header.custom-fg .dd-menu a, .site-header.custom-fg .dd-menu button { color: var(--text) !important; }
@media (max-width: 680px) {
  .dd-menu { position: static; box-shadow: none; border: 0; border-left: 2px solid var(--border); border-radius: 0; margin: 6px 0 0 4px; background: transparent; }
  .dd-menu a, .dd-menu button { padding: 7px 12px; }
}

/* Wide account pages: coloured panel + roomy form */
.account-wrap { max-width: 1160px; }
.account-side { background: linear-gradient(145deg, var(--accent), var(--accent-d)); color: #fff; padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.account-side h2 { color: #fff; font-size: 1.7rem; margin: 0 0 8px; }
.account-side p { margin: 0 0 14px; opacity: .92; font-size: 1.05rem; }
.account-logo { max-height: 60px; max-width: 200px; width: auto; margin-bottom: 18px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.account-perks { margin: 4px 0 0; padding-left: 20px; opacity: .95; line-height: 1.7; }
.account-main { padding: 44px 48px; }
.account-main h1 { font-size: 1.9rem; margin-bottom: 18px; }
.account-main .comment-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.account-main .comment-form > p, .account-main .comment-form > button { grid-column: 1 / -1; }
.account-main .comment-form > p.half { grid-column: auto; }
.account-main .comment-form > button { justify-self: start; padding: .7em 2em; font-size: 1rem; }
@media (max-width: 860px) {
  .account-box { grid-template-columns: 1fr; }
  .account-side { padding: 28px 26px; }
  .account-main { padding: 28px 24px; }
  .account-main .comment-form { grid-template-columns: 1fr; }
}

/* The dropdown must stay closed until opened (beats the generic ".main-nav ul" flex rule) */
.main-nav .dd-menu { display: none; flex-direction: column; gap: 0; }
.main-nav .nav-dropdown.open .dd-menu { display: block; }
@media (max-width: 680px) { .main-nav .nav-dropdown.open .dd-menu { display: block; } }

.slide-overlay.no-shade { background: none; }


/* Top bar: welcome text + live date and time */
.topbar { background: var(--accent-d, #0b5a54); color: #fff; font-size: .85rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 36px; padding-top: 5px; padding-bottom: 5px; }
.topbar-welcome { font-weight: 600; }
.topbar-clock { font-variant-numeric: tabular-nums; opacity: .95; white-space: nowrap; }
.topbar a { color: inherit; }
@media (max-width: 680px) { .topbar-inner { flex-direction: column; gap: 2px; text-align: center; min-height: 0; } .topbar-clock { white-space: normal; } }
/* Embedded videos */
.video-embed { position: relative; width: 100%; max-width: 960px; aspect-ratio: 16 / 9; margin: 1.2em 0; border-radius: 12px; overflow: hidden; background: #000; box-shadow: var(--shadow); }
.video-embed iframe, .video-embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-embed.video-file video { object-fit: contain; }

/* Keeps a hidden title available to screen readers */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
