/*
Theme Name: Sorsaga
Theme URI: https://sorsaga.com
Author: Ben Krüger
Author URI: https://sorsaga.com
Description: Block theme for Sorsaga, a one-person indie studio making story-driven card battlers. Dark, painted, Norse. Includes page patterns for Home, Fylgja, Devlog and About, and a one-click setup under Appearance → Sorsaga Setup.
Version: 1.0.3
Requires at least: 6.6
Tested up to: 6.9
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: sorsaga
*/

/* ---------- Base ---------- */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::selection { background: #C9A45C; color: #111111; }
.wp-site-blocks { min-height: 100vh; display: flex; flex-direction: column; }
.wp-site-blocks > main { flex: 1 0 auto; }
p { color: #B5AE9F; }
strong { color: #E8E1D3; }
a { text-underline-offset: 3px; }

/* ---------- Logo ---------- */
.sg-logo { display: inline-flex; align-items: baseline; white-space: nowrap; font-family: Cinzel, Georgia, serif; font-weight: 700; line-height: 1; color: #E8E1D3; text-decoration: none; }
.sg-logo span { margin-right: 0.08em; }
.sg-logo span:last-child { margin-right: 0; }
.sg-logo svg { width: 0.72em; height: 0.82em; margin: 0 0.12em 0 0.06em; overflow: visible; }
a.sg-logo:hover, a.sg-logo:focus { color: #E8E1D3; }
.sg-logo--header { font-size: 24px; }
.sg-logo--footer { font-size: 18px; }
.sg-logo--hero { font-size: clamp(44px, 8vw, 104px); }

/* ---------- Header & footer ---------- */
.sg-header { border-bottom: 1px solid #262626; }
.sg-header-inner { padding-block: 14px; }
.sg-nav .wp-block-navigation-item__content { color: #B5AE9F; padding: 10px 4px; }
.sg-nav .wp-block-navigation-item__content:hover,
.sg-nav .current-menu-item > .wp-block-navigation-item__content { color: #E8E1D3; }
.sg-nav .wp-block-navigation__responsive-container.is-menu-open { background: #111111; color: #E8E1D3; }
.sg-header .wp-block-button__link { font-size: 15px; padding: 11px 18px; }
.sg-footer { border-top: 1px solid #262626; margin-top: 0; }
.sg-footer-inner { padding-block: 32px; }
.sg-footer p, .sg-footer a { font-size: 14px; }
.sg-footer a { color: #B5AE9F; }
.sg-footer a:hover { color: #E8E1D3; }

/* ---------- Sections ---------- */
.sg-section { padding-bottom: 88px; }
.sg-section:first-child { padding-top: 88px; }
.sg-hero { padding: 96px 0 80px; text-align: center; }
.sg-hero > * { margin-left: auto !important; margin-right: auto !important; }
.sg-hero .wp-block-buttons { justify-content: center; }
.sg-hero-title { font-weight: 500 !important; font-size: clamp(24px, 3vw, 34px) !important; letter-spacing: 0.04em; }
.sg-lead { font-size: 18px; max-width: 680px; }
.sg-lead--bright { font-size: 20px; color: #E8E1D3; }
.sg-eyebrow { font-family: Inter, system-ui, sans-serif !important; font-size: 13px !important; font-weight: 600 !important; letter-spacing: 0.16em; text-transform: uppercase; color: #9A9384 !important; margin-bottom: 24px !important; }
.sg-meta { font-size: 14px; color: #9A9384; }
.sg-title-xl { font-size: clamp(48px, 7vw, 88px) !important; letter-spacing: 0.12em; line-height: 1 !important; }
.sg-game-title { font-size: 44px !important; letter-spacing: 0.1em; }
.sg-tagline { font-family: Cinzel, Georgia, serif; font-size: clamp(20px, 2.4vw, 26px); color: #C9A45C; }
.sg-quote { border-left: 2px solid #C9A45C; padding-left: 20px; font-family: Cinzel, Georgia, serif; font-size: 20px; line-height: 1.5; color: #C9A45C; }
.sg-arrow { font-weight: 600; }
.sg-arrow a { text-decoration: none; }

/* ---------- Cards ---------- */
.sg-card { background: #181818; border: 1px solid #262626; border-radius: 16px; padding: 28px; }
.sg-card > :first-child { margin-top: 0; }
.sg-card h3 { font-size: 20px; margin-bottom: 0; }
.sg-card h3 + p { margin-top: 10px; }
.sg-card--dashed { border-style: dashed; border-color: #4A4640; }
.sg-card--ember { background: #1E1B16; border-color: #5A4A2A; }
.sg-card--flush { padding: 0; overflow: hidden; }
.sg-card--flush .wp-block-column:last-child { padding: 40px; }
.sg-card--big { padding: 48px 40px; }
.sg-card--accent { border-left: 3px solid #C9A45C; border-radius: 12px; }
.sg-label { font-size: 12px !important; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: #C9A45C; margin-bottom: 10px !important; }

/* ---------- Badges ---------- */
.sg-badges { gap: 8px !important; }
.sg-badge { display: inline-block; margin: 0 !important; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #111111; background: #C9A45C; padding: 6px 12px; border-radius: 999px; line-height: 1.4; }
.sg-badge--outline { color: #C9A45C; background: transparent; border: 1px solid #C9A45C; }

/* ---------- Status banner ---------- */
.sg-status { background: #1E1B16; border: 1px solid #5A4A2A; border-radius: 12px; padding: 18px 22px; align-items: center; }
.sg-status p { color: #E8E1D3; margin: 0; }
.sg-status .sg-status-text { flex: 1 1 360px; }

/* ---------- Buttons ---------- */
.wp-block-button.is-style-outline > .wp-block-button__link { background: transparent; color: #E8E1D3; border: 1px solid #4A4640; padding: 13px 21px; }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { border-color: #C9A45C; color: #C9A45C; }

/* ---------- Light box (newsletter) ---------- */
.sg-light { background: #E8E1D3; border-radius: 16px; padding: 48px 40px; }
.sg-light h2 { color: #111111 !important; font-size: 28px !important; }
.sg-light p { color: #3A352C; }
.sg-light a:not(.wp-block-button__link) { color: #111111; }
.sg-light .wp-block-button__link { background: #111111; color: #E8E1D3; }
.sg-light .wp-block-button__link:hover { background: #3A352C; color: #E8E1D3; }
.sg-light input[type="email"], .sg-light input[type="text"] { min-height: 48px; padding: 0 16px; border: 1px solid #8E887C; border-radius: 8px; font-size: 16px; background: #FFFFFF; color: #111111; }

/* ---------- Placeholders (image blocks without an image yet) ---------- */
.sg-ph { margin: 0; }
.sg-ph:not(:has(img[src])) { border: 1px dashed #4A4640; border-radius: 12px; background: #181818; min-height: 220px; display: flex; align-items: center; justify-content: center; }
.sg-ph:not(:has(img[src]))::after { content: "Image"; color: #9A9384; font-size: 14px; }
.sg-ph img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block; }
.sg-ph--banner, .sg-ph--banner:not(:has(img[src])) { min-height: 0; aspect-ratio: 16 / 6; }
.sg-ph--keyart, .sg-ph--keyart:not(:has(img[src])) { min-height: 0; aspect-ratio: 4 / 3; border-radius: 0; border: 0; }
.sg-ph--keyart img { border-radius: 0; }
.sg-ph--portrait, .sg-ph--portrait:not(:has(img[src])) { min-height: 0; aspect-ratio: 4 / 5; }
.sg-ph--shot, .sg-ph--shot:not(:has(img[src])) { min-height: 0; aspect-ratio: 16 / 9; }
.sg-ph--post, .sg-ph--post:not(:has(img[src])) { min-height: 0; aspect-ratio: 16 / 9; }

/* ---------- Characters ---------- */
.sg-char { padding: 0; overflow: hidden; }
.sg-char > .sg-ph { border-radius: 0 !important; border: 0 !important; border-bottom: 1px dashed #4A4640 !important; }
.sg-char > .sg-ph img { border-radius: 0; }
.sg-char > :not(.sg-ph) { margin-left: 28px !important; margin-right: 28px !important; }
.sg-char > :last-child { margin-bottom: 28px !important; }
.sg-char h3 { font-size: 24px !important; margin-top: 24px !important; }
.sg-char .sg-meta { margin-top: 4px !important; }
.wp-block-audio audio { width: 100%; min-width: 0; color-scheme: dark; }

/* ---------- Details (transcripts, FAQ) ---------- */
.wp-block-details summary { cursor: pointer; color: #C9A45C; font-weight: 600; padding: 6px 0; }
.sg-transcript p { font-family: Cinzel, Georgia, serif; color: #E8E1D3; font-size: 16px; }
.sg-faq { border-top: 1px solid #262626; }
.sg-faq .wp-block-details { border-bottom: 1px solid #262626; padding: 4px 0; margin: 0 !important; }
.sg-faq .wp-block-details summary { color: #E8E1D3; font-size: 18px; padding: 18px 0; }
.sg-faq .wp-block-details[open] summary { color: #C9A45C; }
.sg-faq .wp-block-details p { margin: 0 0 20px; max-width: 820px; }

/* ---------- Stats ---------- */
.sg-stat { padding: 24px 28px; }
.sg-stat-num { font-family: Cinzel, Georgia, serif; font-weight: 700; font-size: 44px; line-height: 1.1; color: #C9A45C; margin: 0 !important; }
.sg-stat-num + p { margin-top: 6px !important; font-size: 15px; }
.sg-stat.sg-card--dashed .sg-stat-num { color: #9A9384; }

/* ---------- Facts list ---------- */
.sg-fact { border-bottom: 1px solid #262626; padding: 14px 0; gap: 8px 24px !important; }
.sg-fact p { margin: 0; }
.sg-fact-k { flex: 0 0 160px; font-size: 14px; color: #9A9384; }
.sg-fact-v { flex: 1 1 240px; color: #E8E1D3; }

/* ---------- Roadmap ---------- */
.sg-step { padding: 24px; }
.sg-step-state { font-size: 12px !important; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; display: inline-block; padding: 4px 10px; border-radius: 999px; margin: 0 !important; color: #B5AE9F; border: 1px solid #4A4640; }
.sg-step--done .sg-step-state { color: #C9A45C; border-color: #5A4A2A; }
.sg-step--now { background: #1E1B16; border-color: #5A4A2A; }
.sg-step--now .sg-step-state { color: #111111; background: #C9A45C; border-color: #C9A45C; }
.sg-step h3 { font-size: 19px !important; }
.sg-step .sg-meta { margin: 12px 0 0 !important; }

/* ---------- Devlog / posts ---------- */
.sg-posts .wp-block-post { background: #181818; border: 1px solid #262626; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.sg-posts .wp-block-post > :not(.wp-block-post-featured-image) { margin-left: 28px; margin-right: 28px; }
.sg-posts .wp-block-post > :last-child { margin-bottom: 28px; }
.sg-posts .wp-block-post-featured-image { margin: 0 0 4px; }
.sg-posts .wp-block-post-featured-image img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.sg-posts .wp-block-post > :first-child:not(.wp-block-post-featured-image) { margin-top: 24px; }
.sg-posts .wp-block-post-terms { font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 20px; }
.sg-posts .wp-block-post-terms a { text-decoration: none; }
.sg-posts .wp-block-post-date { font-size: 13px; color: #9A9384; margin-top: 4px; }
.sg-posts .wp-block-post-title { font-size: 21px; line-height: 1.3; margin-top: 8px; }
.sg-posts .wp-block-post-title a { color: #E8E1D3; text-decoration: none; }
.sg-posts .wp-block-post-title a:hover { color: #C9A45C; }
.sg-posts .wp-block-post-excerpt__more-link { font-weight: 600; text-decoration: none; }
.sg-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sg-chips li { margin: 0; }
.sg-chips a { display: inline-block; font-size: 14px; color: #B5AE9F; border: 1px solid #4A4640; padding: 8px 14px; border-radius: 999px; text-decoration: none; }
.sg-chips a:hover, .sg-chips .current-cat a { color: #111111; background: #C9A45C; border-color: #C9A45C; }
.wp-block-query-pagination a, .wp-block-query-pagination .page-numbers { color: #B5AE9F; }
.sg-single .wp-block-post-featured-image img { border-radius: 16px; }
.sg-single .wp-block-post-content p { font-size: 18px; line-height: 1.75; }

/* ---------- Legal pages ---------- */
.sg-legal h2 { font-family: Inter, system-ui, sans-serif; font-size: 20px; font-weight: 600; margin-top: 40px; }
.sg-legal p { color: #B5AE9F; }

/* ---------- Small screens ---------- */
@media (max-width: 781px) {
	.sg-hero { padding: 64px 0 56px; }
	.sg-section { padding-bottom: 64px; }
	.sg-section:first-child { padding-top: 56px; }
	.sg-card--flush .wp-block-column:last-child { padding: 28px; }
	.sg-card--big, .sg-light { padding: 32px 24px; }
	.sg-game-title { font-size: 36px !important; }
}
@media (prefers-reduced-motion: reduce) {
	* { scroll-behavior: auto !important; transition: none !important; }
}
html { scroll-behavior: smooth; }

/* ---------- Contact form (Contact Form 7 + Cloudflare Turnstile) ---------- */
.wpcf7 form { display: grid; gap: 18px; }
.wpcf7 form > p { margin: 0; }
.wpcf7 label { display: block; font-size: 14px; font-weight: 600; color: #E8E1D3; }
.wpcf7 .wpcf7-form-control-wrap { display: block; margin-top: 8px; }
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 select, .wpcf7 textarea {
	width: 100%; box-sizing: border-box; min-height: 48px; padding: 12px 16px;
	background: #111111; color: #E8E1D3; border: 1px solid #4A4640; border-radius: 8px;
	font-family: inherit; font-size: 16px; font-weight: 400; line-height: 1.5;
}
.wpcf7 textarea { min-height: 180px; resize: vertical; }
.wpcf7 select {
	appearance: none; padding-right: 44px; cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23C9A45C' stroke-width='2'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 16px center;
}
.wpcf7 input:focus, .wpcf7 select:focus, .wpcf7 textarea:focus { border-color: #C9A45C; outline: 2px solid #C9A45C; outline-offset: 2px; }
.wpcf7 ::placeholder { color: #8E887C; opacity: 1; }
.wpcf7 .wpcf7-not-valid { border-color: #E39A84; }
.wpcf7 .wpcf7-not-valid-tip { color: #E39A84; font-size: 14px; font-weight: 400; margin-top: 6px; }
.wpcf7 input[type="submit"] {
	justify-self: start; cursor: pointer; border: 0; border-radius: 8px; padding: 14px 22px;
	background: #C9A45C; color: #111111; font-family: inherit; font-size: 16px; font-weight: 600;
}
.wpcf7 input[type="submit"]:hover { background: #E8E1D3; }
.wpcf7 input[type="submit"]:focus-visible { outline: 2px solid #E8E1D3; outline-offset: 3px; }
.wpcf7 input[type="submit"]:disabled { opacity: 0.6; cursor: wait; }
.wpcf7 form .wpcf7-response-output { margin: 0; padding: 12px 16px; border: 1px solid #4A4640; border-radius: 8px; color: #E8E1D3; font-size: 15px; }
.wpcf7 form.sent .wpcf7-response-output { border-color: #C9A45C; }
.wpcf7 form.invalid .wpcf7-response-output, .wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output, .wpcf7 form.aborted .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output { border-color: #E39A84; }
.wpcf7 .sg-form-note, .sg-form-note { font-size: 14px; color: #9A9384; }
.wpcf7 .cf-turnstile, .wpcf7 .sct-turnstile { min-height: 65px; }
.sg-card .wpcf7 { margin-top: 0; }

/* ---------- Newsletter form (MailPoet) inside the light box ---------- */
.sg-light .mailpoet_form { padding: 0 !important; background: transparent !important; }
.sg-light .mailpoet_form form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.sg-light .mailpoet_form .mailpoet_paragraph { margin: 0 !important; padding: 0 !important; }
.sg-light .mailpoet_form .mailpoet_paragraph:has(.mailpoet_text) { flex: 1 1 240px; }
.sg-light .mailpoet_form .mailpoet_paragraph:not(:has(input)) { flex: 1 1 100%; font-size: 14px; color: #3A352C; }
.sg-light .mailpoet_form label, .sg-light .mailpoet_form .mailpoet_text_label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: #111111; }
.sg-light .mailpoet_form input.mailpoet_text {
	width: 100% !important; box-sizing: border-box; min-height: 48px; padding: 0 16px !important;
	border: 1px solid #8E887C !important; border-radius: 8px !important; background: #FFFFFF !important;
	color: #111111 !important; font-family: inherit !important; font-size: 16px !important;
}
.sg-light .mailpoet_form input.mailpoet_submit {
	min-height: 48px; padding: 0 22px !important; border: 0 !important; border-radius: 8px !important; cursor: pointer;
	background: #111111 !important; color: #E8E1D3 !important; font-family: inherit !important; font-size: 16px !important; font-weight: 600 !important; width: auto !important;
}
.sg-light .mailpoet_form input.mailpoet_submit:hover { background: #3A352C !important; }
.sg-light .mailpoet_form input:focus-visible { outline: 2px solid #111111 !important; outline-offset: 2px; }
.sg-light .mailpoet_form .mailpoet_message { flex: 1 1 100%; margin: 0; }
.sg-light .mailpoet_form .mailpoet_validate_success { color: #2F5A2E !important; font-weight: 600; margin: 0; }
.sg-light .mailpoet_form .mailpoet_validate_error { color: #8A2E1E !important; font-weight: 600; margin: 0; }
.sg-light .mailpoet_form .parsley-errors-list { margin: 6px 0 0; padding: 0; list-style: none; color: #8A2E1E; font-size: 14px; }
.sg-light .mailpoet_form a { color: #111111; }

/* ---------- Legal pages: language switch ---------- */
.sg-langswitch { display: inline-flex; gap: 4px; margin: 0 0 24px; padding: 4px; border: 1px solid #262626; border-radius: 999px; }
.sg-langswitch a { padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: #B5AE9F; text-decoration: none; }
.sg-langswitch a:hover { color: #E8E1D3; }
.sg-langswitch a[aria-current="page"] { background: #C9A45C; color: #111111; }
.sg-legal-note { font-size: 14px; color: #9A9384; margin-top: 0; }
