/*
Theme Name: Kingdom 1566
Theme URI: https://atxta.com/
Author: ATXTA / Kingdom 1566
Description: A dark medieval-fantasy community theme for a kingdom portal with alliance-managed pages, shared guides, NAP information, events, and news.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kingdom-1566
Tags: custom-logo, custom-menu, featured-images, full-width-template, block-styles, wide-blocks, threaded-comments, translation-ready
*/

:root {
  --ks-bg: #070b10;
  --ks-panel: #0d141d;
  --ks-panel-2: #111b27;
  --ks-gold: #d7a84b;
  --ks-gold-light: #f0cf83;
  --ks-blue: #19314e;
  --ks-text: #edf1f5;
  --ks-muted: #a9b2bd;
  --ks-border: rgba(215, 168, 75, .42);
  --ks-danger: #9e3e2f;
  --ks-shadow: 0 18px 60px rgba(0,0,0,.45);
  --ks-radius: 12px;
  --ks-max: 1320px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ks-text);
  background:
    radial-gradient(circle at 12% 5%, rgba(37, 65, 99, .28), transparent 34rem),
    linear-gradient(180deg, #090e15 0%, #05070a 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}
a { color: var(--ks-gold-light); text-decoration: none; }
a:hover { color: #fff1bf; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }

.ks-container { width: min(calc(100% - 36px), var(--ks-max)); margin-inline: auto; }
.ks-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 8, 12, .94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ks-border);
  box-shadow: 0 8px 28px rgba(0,0,0,.38);
}
.admin-bar .site-header { top: 32px; }
.ks-header-inner { min-height: 84px; display: flex; align-items: center; gap: 28px; }
.site-branding { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.custom-logo { max-height: 58px; width: auto; }
.ks-brand-mark {
  width: 52px; height: 58px; display: grid; place-items: center;
  clip-path: polygon(50% 0, 92% 14%, 84% 74%, 50% 100%, 16% 74%, 8% 14%);
  background: linear-gradient(145deg, #314968, #0b1623 62%);
  border: 1px solid var(--ks-gold);
  color: var(--ks-gold-light); font-size: 25px;
  filter: drop-shadow(0 5px 10px rgba(0,0,0,.55));
}
.site-title { margin: 0; font: 700 clamp(1.25rem, 2vw, 2rem)/1.05 Georgia, "Times New Roman", serif; letter-spacing: .08em; text-transform: uppercase; color: var(--ks-gold-light); }
.site-description { margin: 4px 0 0; color: var(--ks-muted); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; }

.main-navigation { margin-left: auto; }
.main-navigation ul { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.main-navigation a { display: block; padding: 13px 13px; color: #e7e9ec; font: 600 .83rem/1 Georgia, serif; letter-spacing: .065em; text-transform: uppercase; border-bottom: 2px solid transparent; }
.main-navigation a:hover, .main-navigation .current-menu-item > a, .main-navigation .current_page_item > a { color: var(--ks-gold-light); border-color: var(--ks-gold); }
.ks-menu-toggle { display: none; margin-left: auto; background: transparent; color: var(--ks-text); border: 1px solid var(--ks-border); border-radius: 8px; padding: 9px 12px; }

/* Hero */
.ks-hero {
  position: relative;
  min-height: 610px;
  display: grid;
  align-items: center;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid var(--ks-border);
  background: #0a1017 url('assets/images/kingdom-hero.svg') center/cover no-repeat;
}
.ks-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(2,5,8,.92) 0%, rgba(4,8,13,.57) 44%, rgba(3,6,10,.35) 70%, rgba(3,5,8,.78) 100%), linear-gradient(180deg, rgba(0,0,0,.22), rgba(0,0,0,.62));
}
.ks-hero::after {
  content: ""; position: absolute; inset: auto 0 0; height: 170px; z-index: -1;
  background: linear-gradient(transparent, var(--ks-bg));
}
.ks-hero-content { max-width: 790px; padding: 92px 0 115px; }
.ks-eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--ks-gold-light); text-transform: uppercase; letter-spacing: .22em; font: 700 .82rem/1 Georgia, serif; }
.ks-eyebrow::before, .ks-eyebrow::after { content: ""; width: 42px; height: 1px; background: var(--ks-gold); opacity: .75; }
.ks-hero h1 { margin: 18px 0 12px; color: #f6d992; font: 700 clamp(3rem, 7vw, 6.2rem)/.94 Georgia, "Times New Roman", serif; letter-spacing: .04em; text-transform: uppercase; text-shadow: 0 5px 22px #000; }
.ks-hero-subtitle { max-width: 650px; color: #f4f6f8; font: 500 clamp(1.2rem, 2.3vw, 1.75rem)/1.45 Georgia, serif; text-shadow: 0 3px 16px #000; }
.ks-hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.ks-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 0 22px; border-radius: 5px;
  border: 1px solid var(--ks-gold); background: linear-gradient(180deg, #233e60, #102036);
  color: #fff4cf; font: 700 .88rem/1 Georgia, serif; letter-spacing: .08em; text-transform: uppercase;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.3), 0 9px 22px rgba(0,0,0,.34);
}
.ks-button:hover { color: #fff; transform: translateY(-1px); }
.ks-button--gold { background: linear-gradient(180deg, #c79437, #7d5313); color: white; }
.ks-button--ghost { background: rgba(5,10,16,.62); }

/* Sections */
.ks-section { padding: 78px 0; }
.ks-section--tight { padding: 48px 0; }
.ks-section--panel { background: linear-gradient(180deg, rgba(17,27,39,.82), rgba(7,11,16,.94)); border-block: 1px solid rgba(215,168,75,.18); }
.ks-section-heading { margin-bottom: 34px; text-align: center; }
.ks-section-heading h2 { margin: 0; color: var(--ks-gold-light); font: 700 clamp(1.8rem, 4vw, 3rem)/1.1 Georgia, serif; text-transform: uppercase; letter-spacing: .055em; }
.ks-section-heading p { max-width: 720px; margin: 10px auto 0; color: var(--ks-muted); }
.ks-divider { width: 160px; height: 1px; margin: 18px auto; background: linear-gradient(90deg, transparent, var(--ks-gold), transparent); }

.ks-grid { display: grid; gap: 22px; }
.ks-grid--alliances { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ks-grid--cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ks-grid--two { grid-template-columns: minmax(0, 1.7fr) minmax(290px, .8fr); }

.ks-card {
  position: relative; overflow: hidden;
  background: linear-gradient(145deg, rgba(19,31,44,.96), rgba(8,13,19,.98));
  border: 1px solid var(--ks-border); border-radius: var(--ks-radius); box-shadow: var(--ks-shadow);
}
.ks-card::before { content: ""; position: absolute; inset: 7px; pointer-events: none; border: 1px solid rgba(215,168,75,.11); border-radius: 8px; }
.ks-card-body { position: relative; padding: 28px; }

.ks-alliance-card { min-height: 245px; text-align: center; transition: transform .18s ease, border-color .18s ease; }
.ks-alliance-card:hover { transform: translateY(-5px); border-color: var(--ks-gold); }
.ks-shield {
  width: 78px; height: 88px; margin: 0 auto 16px; display: grid; place-items: center;
  clip-path: polygon(50% 0, 92% 13%, 84% 72%, 50% 100%, 16% 72%, 8% 13%);
  background: linear-gradient(145deg, var(--ks-accent, #315b87), #0b1420 70%);
  color: #fff0c7; border: 1px solid var(--ks-gold); font: 700 1.15rem/1 Georgia, serif;
  filter: drop-shadow(0 10px 10px rgba(0,0,0,.45));
}
.ks-alliance-tag { margin: 0; color: #fff0c7; font: 700 1.55rem/1 Georgia, serif; letter-spacing: .09em; }
.ks-alliance-name { color: #fff; font-weight: 700; margin-top: 7px; }
.ks-alliance-motto { color: var(--ks-muted); margin: 10px 0 0; font-family: Georgia, serif; }
.ks-status { display: inline-flex; gap: 7px; align-items: center; margin-top: 14px; padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.06); color: #cbd4dc; font-size: .78rem; }
.ks-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5ebc79; box-shadow: 0 0 9px #5ebc79; }

.ks-feature-card { min-height: 265px; display: flex; flex-direction: column; }
.ks-feature-card .ks-card-body { margin-top: auto; }
.ks-feature-icon { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--ks-border); border-radius: 10px; color: var(--ks-gold-light); background: rgba(215,168,75,.07); font-size: 1.35rem; }
.ks-feature-card h3 { margin: 18px 0 9px; color: var(--ks-gold-light); font: 700 1.28rem/1.2 Georgia, serif; text-transform: uppercase; }
.ks-feature-card p { color: var(--ks-muted); }
.ks-card-link { display: inline-flex; margin-top: 8px; color: #fff; font-weight: 700; }

/* Events */
.ks-events { display: grid; gap: 12px; }
.ks-event {
  display: grid; grid-template-columns: 72px minmax(0,1fr) auto; align-items: center; gap: 18px;
  padding: 18px 20px; background: rgba(12,20,29,.92); border: 1px solid rgba(215,168,75,.26); border-radius: 10px;
}
.ks-event-date { text-align: center; border-right: 1px solid var(--ks-border); }
.ks-event-date strong { display: block; color: var(--ks-gold-light); font: 700 1.6rem/1 Georgia, serif; }
.ks-event-date span { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ks-muted); }
.ks-event h3 { margin: 0; font: 700 1.15rem/1.2 Georgia, serif; }
.ks-event-meta { margin-top: 5px; color: var(--ks-muted); font-size: .88rem; }
.ks-time-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.ks-time-pill { padding: 6px 9px; border: 1px solid rgba(215,168,75,.24); border-radius: 999px; color: #dce7f2; font-size: .78rem; white-space: nowrap; }
.ks-time-pill--local { color: var(--ks-gold-light); }

/* Content */
.site-main { min-height: 60vh; }
.ks-page-hero { padding: 80px 0 52px; background: linear-gradient(180deg, rgba(14,25,37,.96), rgba(6,10,15,.96)); border-bottom: 1px solid var(--ks-border); text-align: center; }
.ks-page-hero h1 { margin: 0; color: var(--ks-gold-light); font: 700 clamp(2.2rem, 5vw, 4.5rem)/1 Georgia, serif; text-transform: uppercase; letter-spacing: .05em; }
.ks-page-hero p { margin: 14px auto 0; max-width: 760px; color: var(--ks-muted); }
.ks-content-wrap { padding: 64px 0 88px; }
.entry-content, .ks-prose { color: #d9dfe5; }
.entry-content > * { max-width: 860px; margin-inline: auto; }
.entry-content > .alignwide { max-width: 1180px; }
.entry-content > .alignfull { max-width: none; }
.entry-content h2, .entry-content h3, .entry-content h4, .ks-prose h2, .ks-prose h3 { color: var(--ks-gold-light); font-family: Georgia, serif; }
.entry-content blockquote { border-left: 3px solid var(--ks-gold); margin: 28px auto; padding: 10px 22px; background: rgba(215,168,75,.06); color: #f0e6ce; }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { padding: 12px; border: 1px solid rgba(215,168,75,.22); }
.entry-content th { background: rgba(215,168,75,.1); color: var(--ks-gold-light); }

.ks-alliance-hero { padding: 72px 0; border-bottom: 1px solid var(--ks-border); background: linear-gradient(115deg, rgba(10,16,23,.98), rgba(20,34,49,.9)); }
.ks-alliance-hero-inner { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 32px; align-items: center; }
.ks-alliance-hero .ks-shield { width: 132px; height: 148px; margin: 0; font-size: 2rem; }
.ks-alliance-hero h1 { margin: 0; color: var(--ks-gold-light); font: 700 clamp(2.3rem, 5vw, 4.5rem)/1 Georgia, serif; }
.ks-alliance-hero .ks-motto { font: italic 1.2rem/1.5 Georgia, serif; color: #e3d4ad; }
.ks-alliance-meta { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-top: 26px; }
.ks-meta-box { padding: 14px 16px; background: rgba(255,255,255,.045); border: 1px solid rgba(215,168,75,.2); border-radius: 9px; }
.ks-meta-label { display: block; color: var(--ks-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; }
.ks-meta-value { display: block; margin-top: 4px; color: #fff; font-weight: 700; }

.ks-sidebar { align-self: start; position: sticky; top: 110px; }
.ks-sidebar-card { padding: 24px; background: rgba(13,20,29,.94); border: 1px solid var(--ks-border); border-radius: var(--ks-radius); }
.ks-sidebar-card + .ks-sidebar-card { margin-top: 18px; }
.ks-sidebar-card h3 { margin-top: 0; color: var(--ks-gold-light); font: 700 1.15rem/1.2 Georgia, serif; text-transform: uppercase; }
.ks-link-list { list-style: none; margin: 0; padding: 0; }
.ks-link-list li + li { border-top: 1px solid rgba(215,168,75,.13); }
.ks-link-list a { display: flex; justify-content: space-between; padding: 10px 0; color: #e7edf3; }

/* WordPress utilities */
.posts-navigation, .post-navigation { margin-top: 38px; }
.wp-block-button__link { background: linear-gradient(180deg, #b98630, #6f480e); border-radius: 5px; }
.wp-block-separator { border-color: var(--ks-border); }
.ks-notice { padding: 22px 24px; border: 1px solid var(--ks-border); border-left: 4px solid var(--ks-gold); background: rgba(215,168,75,.07); border-radius: 8px; }

/* Footer */
.site-footer { background: #05080c; border-top: 1px solid var(--ks-border); }
.ks-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 54px 0; }
.site-footer h2, .site-footer h3 { color: var(--ks-gold-light); font-family: Georgia, serif; }
.site-footer p, .site-footer li { color: var(--ks-muted); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.ks-footer-bottom { padding: 18px 0; border-top: 1px solid rgba(215,168,75,.13); color: #7f8995; font-size: .82rem; text-align: center; }

/* Responsive */
@media (max-width: 1080px) {
  .ks-grid--alliances, .ks-grid--cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ks-grid--two { grid-template-columns: 1fr; }
  .ks-sidebar { position: static; }
  .ks-menu-toggle { display: inline-flex; }
  .main-navigation { display: none; position: absolute; inset: 84px 18px auto; padding: 12px; background: #080d13; border: 1px solid var(--ks-border); border-radius: 10px; }
  .main-navigation.is-open { display: block; }
  .main-navigation ul { display: block; }
  .main-navigation a { padding: 14px; }
}
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 720px) {
  .ks-header-inner { min-height: 74px; }
  .site-description { display: none; }
  .ks-hero { min-height: 540px; }
  .ks-hero-content { padding: 80px 0; }
  .ks-grid--alliances, .ks-grid--cards { grid-template-columns: 1fr; }
  .ks-event { grid-template-columns: 60px 1fr; }
  .ks-time-pills { grid-column: 1 / -1; justify-content: flex-start; }
  .ks-footer-grid { grid-template-columns: 1fr; }
  .ks-alliance-hero-inner { grid-template-columns: 1fr; text-align: center; }
  .ks-alliance-hero .ks-shield { margin-inline: auto; }
  .ks-alliance-meta { grid-template-columns: 1fr; text-align: left; }
}
