/*
Theme Name: LottoLoom
Theme URI: https://example.com/lottoloom
Author: LottoLoom
Description: A bright, mobile-first theme for lucky number and lottery generator sites. Built as the companion to the LottoLoom Lottery Number Generator plugin: tool tabs in the header, a scrollable lottery strip, a searchable "jump to a lottery" panel, a phone tab bar, ad widget areas and a customisable colour palette.
Version: 1.1.0
Requires at least: 6.0
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: lottoloom-theme
Tags: one-column, two-columns, right-sidebar, custom-logo, custom-menu, custom-colors, featured-images, threaded-comments, translation-ready, entertainment
*/

:root {
	--ink: #1b1740;
	--ink-2: #2a2461;
	--violet: #5b3df5;
	--gold: #ffb703;
	--coral: #ff5d73;
	--mint: #16c79a;
	--text: #2b2850;
	--muted: #6b6890;
	--line: #e6e3f3;
	--mist: #f5f3fd;
	--bg: #faf9ff;
	--radius: 18px;
	--shadow: 0 1px 2px rgba(27, 23, 64, .06), 0 8px 24px -12px rgba(27, 23, 64, .18);
	--font-head: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.65;
	color: var(--text);
	background:
		radial-gradient(1200px 400px at 110% -10%, rgba(91, 61, 245, .07), transparent 60%),
		radial-gradient(900px 380px at -10% 0%, rgba(255, 183, 3, .08), transparent 60%),
		var(--bg);
	overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--violet); text-underline-offset: .18em; }
a:hover { color: var(--ink); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); color: var(--ink); line-height: 1.2; letter-spacing: -.01em; margin: 1.6em 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1.1em; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed !important; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 1000; background: #fff; padding: 10px 14px; border-radius: 10px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }

/* ---------- header ---------- */
.site-header { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 6px 24px -14px rgba(0, 0, 0, .5); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; position: relative; } }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand:hover { color: inherit; }
.brand-mark { flex: 0 0 auto; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .25)); }
.brand-text { display: grid; line-height: 1.1; }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; }
.brand-tag { font-size: .72rem; opacity: .7; }
.site-header .brand-name { color: #fff; }
.custom-logo-link img { max-height: 48px; width: auto; }

.primary-nav { margin-left: auto; }
.primary-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.primary-nav a { display: block; padding: 8px 14px; border-radius: 999px; color: rgba(255, 255, 255, .82); text-decoration: none; font-weight: 600; font-size: .93rem; transition: background .15s, color .15s; }
.primary-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.primary-nav .current-menu-item > a, .primary-nav .current_page_item > a { background: var(--gold); color: var(--ink); }
.primary-nav .sub-menu { list-style: none; margin: 0; padding: 6px; position: absolute; background: var(--ink-2); border-radius: 12px; display: none; min-width: 200px; box-shadow: var(--shadow); }
.primary-nav li { position: relative; }
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: block; }

.nav-toggle { display: none; margin-left: auto; background: rgba(255, 255, 255, .08); border: 0; border-radius: 12px; width: 44px; height: 44px; cursor: pointer; color: #fff; }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; margin: 0 auto; position: relative; transition: transform .2s, opacity .2s; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
	.nav-toggle { display: block; }
	.primary-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--ink); padding: 8px 16px 16px; display: none; border-top: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 20px 30px -20px rgba(0, 0, 0, .6); }
	.primary-nav.is-open { display: block; }
	.primary-nav .menu { flex-direction: column; }
	.primary-nav a { border-radius: 10px; padding: 12px 14px; }
	.primary-nav .sub-menu { position: static; display: block; background: transparent; box-shadow: none; padding-left: 12px; }
}

/* lottery strip */
.lotto-strip { background: var(--ink-2); border-top: 1px solid rgba(255, 255, 255, .06); }
.lotto-strip__inner { display: flex; align-items: center; gap: 8px; }
.lotto-strip__scroller { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); }
.lotto-strip__scroller::-webkit-scrollbar { display: none; }
.lotto-strip .menu { list-style: none; margin: 0; padding: 8px 24px 8px 0; display: flex; gap: 6px; white-space: nowrap; }
.lotto-strip a { display: block; padding: 5px 12px; border-radius: 999px; color: rgba(255, 255, 255, .85); font-size: .84rem; font-weight: 600; text-decoration: none; border: 1px solid rgba(255, 255, 255, .14); transition: all .15s; }
.lotto-strip a:hover, .lotto-strip .current-menu-item a { background: #fff; color: var(--ink); border-color: #fff; }
.lotto-strip__more { flex: 0 0 auto; background: var(--gold); color: var(--ink); border: 0; border-radius: 999px; padding: 5px 12px; font-weight: 800; letter-spacing: .08em; cursor: pointer; font-size: .8rem; }

/* ---------- layout ---------- */
.site-content { padding: 28px 0 48px; min-height: 50vh; }
.layout { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
.has-sidebar .layout { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .has-sidebar .layout { grid-template-columns: minmax(0, 1fr) 320px; } }
.site-main { min-width: 0; }

.page-header { margin-bottom: 20px; }
.page-title { margin: 0 0 .2em; }
.page-lead { color: var(--muted); font-size: 1.05rem; margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-weight: 800; font-size: .74rem; color: var(--violet); margin: 0 0 6px; }

.hero { text-align: center; padding: 12px 0 26px; }
.hero__title { margin: 0 0 .25em; font-size: clamp(2rem, 5.5vw, 3.2rem); background: linear-gradient(100deg, var(--ink) 20%, var(--violet) 70%, #c04cf1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__text { max-width: 640px; margin: 0 auto; color: var(--muted); font-size: 1.08rem; }

.entry-content > *:first-child { margin-top: 0; }
.entry-content > .ll-app + *, .entry-content > .wp-block-shortcode + * { margin-top: 12px; }
.entry-content > h2, .entry-content > p, .entry-content > ul, .entry-content > ol, .ll-about { max-width: 78ch; }
.entry-content img { border-radius: 12px; }
.entry-content blockquote { border-left: 4px solid var(--gold); margin: 1.5em 0; padding: .4em 1.2em; background: var(--mist); border-radius: 0 12px 12px 0; }
.entry-content table { border-collapse: collapse; width: 100%; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; }
.entry-media { margin: 0 0 24px; }
.entry-media img { border-radius: var(--radius); width: 100%; }
.entry-meta { color: var(--muted); font-size: .88rem; margin: 0; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }

/* posts */
.post-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.post-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.post-card__media img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.post-card__body { padding: 20px; }
.post-card__title { margin: .3em 0 .4em; font-size: 1.2rem; }
.post-card__title a { color: var(--ink); text-decoration: none; }
.post-card__title a:hover { color: var(--violet); }
.post-card__excerpt p { margin: 0; color: var(--muted); }
.pagination, .post-navigation { margin-top: 28px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.pagination .nav-links { justify-content: center; }
.page-numbers { padding: 8px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--line); text-decoration: none; }
.page-numbers.current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* sidebar & widgets */
.sidebar { display: grid; gap: 20px; align-content: start; }
.widget { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.widget:has(> .ll-card) { background: none; border: 0; padding: 0; box-shadow: none; }
.widget-title { margin: 0 0 12px; font-size: 1.05rem; }
.widget ul { margin: 0; padding-left: 1.1em; }

/* forms */
.search-form { display: flex; gap: 8px; }
.search-field, .comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; border: 1.5px solid var(--line); background: var(--mist); border-radius: 10px; padding: 10px 12px; color: var(--text);
}
.search-submit, .comment-form .submit, .button, .wp-block-button__link {
	background: var(--violet); color: #fff; border: 0; border-radius: 10px; padding: 10px 18px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block;
}
.search-submit:hover, .comment-form .submit:hover, .button:hover { background: var(--ink); color: #fff; }

/* comments */
.comments-area { margin-top: 32px; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { border-bottom: 1px solid var(--line); padding: 14px 0; }
.comment-meta img { border-radius: 50%; vertical-align: middle; margin-right: 8px; }

/* 404 */
.not-found { text-align: center; max-width: 640px; margin: 0 auto; }
.big-404 { display: flex; justify-content: center; gap: 10px; margin: 0 0 12px; }
.big-404 span { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: 2rem; color: var(--ink); background: radial-gradient(circle at 32% 28%, #fff 0 18%, #fff5d6 34%, var(--gold) 78%, #e09a00 100%); box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .15), 0 6px 14px -6px rgba(0, 0, 0, .4); }
.big-404 span:nth-child(2) { background: radial-gradient(circle at 32% 28%, #ffd0d7 0 14%, #ff8a9b 36%, var(--coral) 76%, #d63750 100%); color: #fff; }
.not-found .search-form { max-width: 420px; margin: 0 auto 16px; }

/* ads */
.ad-area { text-align: center; }
.ad-area--top { padding-top: 16px; }
.ad-area .widget { background: none; border: 0; box-shadow: none; padding: 0; }
.ad-area .widget-title { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-family: var(--font-body); }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: rgba(255, 255, 255, .75); padding: 48px 0 24px; font-size: .93rem; }
.site-footer a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.3fr .8fr .8fr 2fr; } }
.footer-col--brand p { margin-top: 14px; }
.footer-title { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; margin: 0 0 14px; font-family: var(--font-body); font-weight: 800; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-regions { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.footer-regions h4 { color: var(--gold); font-size: .82rem; margin: 0 0 4px; font-family: var(--font-body); }
.footer-regions p { margin: 0; font-size: .86rem; line-height: 1.7; }
.site-footer .widget { background: none; border: 0; box-shadow: none; padding: 0; color: inherit; }
.site-footer .widget-title { color: #fff; }
.app-link { display: inline-block; margin-top: 4px; padding: 8px 14px; border-radius: 10px; background: rgba(255, 255, 255, .08); font-weight: 700; }
.footer-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); }
.responsible { font-size: .85rem; background: rgba(255, 183, 3, .1); border: 1px solid rgba(255, 183, 3, .25); color: #ffe3a1; padding: 10px 14px; border-radius: 12px; }
.footer-bottom__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.footer-bottom__row p { margin: 0; }
.legal-links { list-style: none; display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 0; }

/* ---------- phone tab bar ---------- */
.tabbar { display: none; }
@media (max-width: 760px) {
	.has-bottom-nav { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
	.tabbar {
		display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
		background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
		border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
		box-shadow: 0 -8px 24px -16px rgba(27, 23, 64, .35);
	}
	.tabbar a { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; color: var(--muted); text-decoration: none; font-size: .68rem; font-weight: 700; border-radius: 12px; }
	.tabbar a.is-active { color: var(--violet); background: var(--mist); }
}

/* ---------- quick shortcuts dialog ---------- */
.shortcuts { border: 0; padding: 0; width: min(880px, calc(100vw - 24px)); max-height: min(84vh, 760px); border-radius: 22px; box-shadow: 0 40px 80px -30px rgba(27, 23, 64, .6); color: var(--text); }
.shortcuts[open] { display: flex; flex-direction: column; }
.shortcuts::backdrop { background: rgba(27, 23, 64, .6); backdrop-filter: blur(4px); }
.shortcuts__head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.shortcuts__head h2 { margin: 0; font-size: 1.2rem; flex: 1 1 auto; }
.shortcuts__search { flex: 1 1 220px; border: 1.5px solid var(--line); background: var(--mist); border-radius: 10px; padding: 8px 12px; }
.shortcuts__close { background: var(--mist); border: 0; width: 38px; height: 38px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; line-height: 1; color: var(--ink); }
.shortcuts__body { overflow: auto; padding: 8px 20px 20px; }
.shortcuts__group h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--violet); margin: 16px 0 8px; font-family: var(--font-body); }
.shortcuts__links { display: flex; flex-wrap: wrap; gap: 6px; }
.shortcuts__links a { padding: 6px 12px; border-radius: 999px; background: var(--mist); border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; font-size: .86rem; font-weight: 600; }
.shortcuts__links a:hover { border-color: var(--violet); color: var(--violet); }
.shortcuts__group[hidden], .shortcuts__links a[hidden] { display: none; }

/* block editor alignment helpers */
.alignwide { max-width: 1180px; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.wp-block-image figcaption, .wp-caption-text { color: var(--muted); font-size: .88rem; text-align: center; }
.sticky .post-card__title::before { content: "★ "; color: var(--gold); }
.bypostauthor > .comment-body .fn::after { content: " ✦"; color: var(--gold); }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.gallery-caption { font-size: .85rem; }

/* ---------- header tools ---------- */
.header-tools { display: flex; gap: 8px; align-items: center; margin-left: 12px; order: 3; }
.header-btn { background: rgba(255, 255, 255, .08); color: #fff; border: 0; border-radius: 12px; height: 40px; min-width: 40px; padding: 0 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: .85rem; }
.header-btn:hover { background: rgba(255, 255, 255, .16); }
.header-btn[hidden] { display: none; }
.header-btn--install { background: var(--gold); color: var(--ink); }
.theme-toggle svg { display: none; }
html[data-theme-mode="auto"] .theme-toggle .icon-auto, html:not([data-theme-mode]) .theme-toggle .icon-auto, html[data-theme-mode="light"] .theme-toggle .icon-light, html[data-theme-mode="dark"] .theme-toggle .icon-dark { display: block; }
.primary-nav { order: 2; }
@media (max-width: 960px) { .header-tools { margin-left: auto; } .nav-toggle { margin-left: 0; order: 4; } }
@media (max-width: 420px) { .header-btn__label { display: none; } .brand-tag { display: none; } }
.primary-nav .menu-item-has-children > a::after { content: " ▾"; font-size: .75em; opacity: .7; }

/* ---------- dark mode ---------- */
html[data-theme="dark"] {
	--text: #dcd9f3;
	--muted: #a9a5cc;
	--line: #2e2a55;
	--mist: #201c40;
	--bg: #0f0c24;
	color-scheme: dark;
}
html[data-theme="dark"] body { background: radial-gradient(1200px 400px at 110% -10%, rgba(91, 61, 245, .16), transparent 60%), radial-gradient(900px 380px at -10% 0%, rgba(255, 183, 3, .06), transparent 60%), var(--bg); }
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3, html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6 { color: #f1efff; }
html[data-theme="dark"] a { color: #a99bff; }
html[data-theme="dark"] a:hover { color: #fff; }
html[data-theme="dark"] .card, html[data-theme="dark"] .widget, html[data-theme="dark"] .page-numbers { background: #17142f; border-color: var(--line); }
html[data-theme="dark"] .post-card__title a { color: #f1efff; }
html[data-theme="dark"] .hero__title { background: linear-gradient(100deg, #fff 20%, #b6a8ff 70%, #f0a6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
html[data-theme="dark"] .site-header, html[data-theme="dark"] .site-footer { background: #0a081c; }
html[data-theme="dark"] .lotto-strip { background: #15122e; }
html[data-theme="dark"] .tabbar { background: rgba(23, 20, 47, .96); border-top-color: var(--line); }
html[data-theme="dark"] .tabbar a.is-active { background: #241f4a; color: #c8bdff; }
html[data-theme="dark"] .shortcuts { background: #17142f; color: var(--text); }
html[data-theme="dark"] .shortcuts__links a { background: #201c40; color: #f1efff; border-color: var(--line); }
html[data-theme="dark"] .shortcuts__close { background: #241f4a; color: #fff; }
html[data-theme="dark"] .search-field, html[data-theme="dark"] .comment-form textarea, html[data-theme="dark"] .comment-form input[type="text"], html[data-theme="dark"] .comment-form input[type="email"] { background: #201c40; color: var(--text); }
html[data-theme="dark"] .entry-content blockquote { background: #201c40; }
html[data-theme="dark"] .big-404 span { color: #1b1740; }
html[data-theme="dark"] .big-404 span:nth-child(2) { color: #fff; }
