/*
Theme Name: GCL
Description: Clean, fast theme for Green Card Lottery USA. Classic PHP templates, no external fonts, WCAG AA contrast.
Version: 1.0.0
Text Domain: gcl
*/

:root {
  --ink: #14202b;
  --ink-soft: #3c4b59;
  --muted: #5b6b79;
  --bg: #ffffff;
  --bg-soft: #f4f7f6;
  --line: #d9e2df;
  --brand: #0b5d4a;
  --brand-dark: #08443a;
  --brand-tint: #e5f2ee;
  --accent: #b4892b;
  --notice-bg: #fff7e0;
  --notice-ink: #4a3a07;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 32, 43, .06), 0 6px 18px rgba(20, 32, 43, .06);
  --font-text: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --wrap: 1120px;
  --measure: 720px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.7 var(--font-text); }
img, svg { max-width: 100%; height: auto; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.screen-reader-text { position: absolute !important; clip: rect(1px, 1px, 1px, 1px); width: 1px; height: 1px; overflow: hidden; }
.skip-link { position: absolute; left: 8px; top: 8px; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 100; border-radius: 6px; transform: translateY(-300%); }
.skip-link:focus { transform: none; color: #fff; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }

/* notice bar */
.notice-bar { background: var(--notice-bg); color: var(--notice-ink); font-size: 14px; line-height: 1.45; border-top: 1px solid #ecd9a0; }
.notice-bar .wrap { padding: 8px 0; }
.notice-bar a { color: inherit; font-weight: 600; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 700 20px/1.1 var(--font-head); }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font: 700 15px/1 var(--font-text); letter-spacing: .02em; }
.brand small { display: block; font: 500 12px/1.2 var(--font-text); color: var(--muted); margin-top: 2px; }
.primary-nav { margin-left: auto; }
.primary-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; align-items: center; }
.primary-nav a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 15.5px; }
.primary-nav a:hover, .primary-nav .is-current a { background: var(--brand-tint); color: var(--brand-dark); }
.primary-nav .nav-cta a { background: var(--brand); color: #fff; font-weight: 600; }
.primary-nav .nav-cta a:hover { background: var(--brand-dark); color: #fff; }
.header-tools { display: flex; align-items: center; gap: 8px; }
.lang { position: relative; }
.lang summary { list-style: none; cursor: pointer; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; color: var(--ink-soft); }
.lang summary::-webkit-details-marker { display: none; }
.lang ul { position: absolute; right: 0; top: calc(100% + 6px); min-width: 160px; margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.lang a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: 14px; }
.lang a:hover { background: var(--brand-tint); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: 600 14px var(--font-text); color: var(--ink); cursor: pointer; }
.search-form { display: flex; gap: 6px; }
.search-form input[type=search] { flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.search-form button, .btn { display: inline-block; padding: 11px 18px; border-radius: 8px; border: 0; background: var(--brand); color: #fff; font: 600 15px var(--font-text); text-decoration: none; cursor: pointer; }
.search-form button:hover, .btn:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--brand-dark); border: 1px solid var(--brand); }
.btn-ghost:hover { background: var(--brand-tint); color: var(--brand-dark); }
.header-search { display: none; border-top: 1px solid var(--line); padding: 12px 0; }
.header-search.is-open { display: block; }

/* breadcrumbs */
.crumbs { font-size: 14px; color: var(--muted); padding: 18px 0 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: nowrap; margin: 0; padding: 0; }
.crumbs li { flex: 0 0 auto; white-space: nowrap; }
.crumbs li:last-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crumbs li + li::before { content: "\203A"; margin: 0 8px; color: #5b6b79; }
.crumbs a { color: var(--ink-soft); }
.crumbs [aria-current] { color: var(--ink); }

/* hero */
.hero { background: linear-gradient(135deg, #0a3b32 0%, #0b5d4a 60%, #137a62 100%); color: #fff; padding: 64px 0 56px; }
.hero h1 { font: 700 clamp(30px, 5vw, 48px)/1.12 var(--font-head); margin: 0 0 16px; max-width: 18ch; letter-spacing: -.01em; }
.hero p { font-size: 19px; max-width: 58ch; margin: 0 0 24px; color: #e3f3ee; }
.hero .btn { background: #fff; color: var(--brand-dark); }
.hero .btn:hover { background: var(--brand-tint); }
.hero .btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .6); margin-left: 8px; }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.hero-note { margin-top: 22px; font-size: 14px; color: #cfe8e0; max-width: 62ch; }

/* sections and cards */
.section { padding: 56px 0; }
.section.soft { background: var(--bg-soft); }
.section h2.title { font: 700 clamp(24px, 3.5vw, 32px)/1.2 var(--font-head); margin: 0 0 8px; }
.section .lead { color: var(--ink-soft); margin: 0 0 28px; max-width: 62ch; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 8px; transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card h3 { font: 700 20px/1.3 var(--font-head); margin: 0; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.card p { margin: 0; color: var(--ink-soft); font-size: 15.5px; line-height: 1.6; }
.card .meta { font-size: 13px; color: var(--muted); margin-top: auto; padding-top: 6px; }
.tag { align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-dark); background: var(--brand-tint); padding: 3px 9px; border-radius: 99px; text-decoration: none; position: relative; z-index: 1; }

/* article */
.article-head { padding: 28px 0 8px; }
.article-head h1, .page-head h1 { font: 700 clamp(30px, 4.6vw, 44px)/1.15 var(--font-head); letter-spacing: -.01em; margin: 10px 0 12px; max-width: 22ch; }
.article-meta { color: var(--muted); font-size: 14.5px; }
.layout { display: grid; gap: 48px; grid-template-columns: minmax(0, var(--measure)) 280px; justify-content: center; padding: 24px 0 64px; }
.layout.no-toc { grid-template-columns: minmax(0, var(--measure)); }
.entry { font-size: 18px; line-height: 1.75; }
.entry > :first-child { font-size: 20px; line-height: 1.6; color: var(--ink); }
.entry h2 { font: 700 28px/1.25 var(--font-head); margin: 2.1em 0 .5em; letter-spacing: -.005em; }
.entry h3 { font: 700 21px/1.3 var(--font-head); margin: 1.6em 0 .4em; }
.entry p, .entry ul, .entry ol { margin: 0 0 1.1em; }
.entry li { margin: .3em 0; }
.entry a { font-weight: 500; }
.entry table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 16px; display: block; overflow-x: auto; }
.entry th, .entry td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; vertical-align: top; }
.entry th { background: var(--bg-soft); font-weight: 700; }
.entry h2 + ul, .entry h2 + table { margin-top: .6em; }
.entry .quick, .entry h2.is-quick { margin-top: 1.6em; }
.quick-box { background: var(--brand-tint); border-left: 4px solid var(--brand); padding: 6px 22px 10px; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.6em 0; }
.quick-box h2 { margin-top: .8em; font-size: 20px; }
.quick-box table { background: #fff; }
.faq-q { font-weight: 700; margin-bottom: .2em !important; margin-top: 1.2em !important; }
.toc { position: sticky; top: 96px; align-self: start; font-size: 15px; border-left: 2px solid var(--line); padding-left: 18px; }
.toc strong { display: block; margin-bottom: 8px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 5px 0; color: var(--ink-soft); text-decoration: none; line-height: 1.4; }
.toc a:hover, .toc a.is-active { color: var(--brand-dark); font-weight: 600; }
.toc-inline { display: none; }

/* page / archive */
.page-head { padding: 28px 0 8px; }
.page-head .desc { color: var(--ink-soft); max-width: 62ch; font-size: 18px; }
.pagination { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 36px; }
.pagination a, .pagination span { padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.subhubs { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.subhubs a { display: block; padding: 7px 14px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; color: var(--ink-soft); font-size: 15px; }
.subhubs a:hover, .subhubs .is-current a { background: var(--brand-tint); color: var(--brand-dark); border-color: var(--brand); }

/* disclosure */
.disclosure { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; background: var(--bg-soft); font-size: 15px; color: var(--ink-soft); margin-top: 40px; }

/* footer */
.site-footer { background: #0e1b24; color: #c4d0d8; padding: 48px 0 28px; margin-top: 0; font-size: 15px; }
.site-footer a { color: #e6eef2; }
.site-footer h2 { font: 700 13px/1 var(--font-text); letter-spacing: .08em; text-transform: uppercase; color: #8fa3b0; margin: 0 0 14px; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 8px; }
.footer-note { border-top: 1px solid #243643; margin-top: 32px; padding-top: 20px; font-size: 14px; color: #a9b9c4; }

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
  .toc-inline { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 1.6em; font-size: 15.5px; background: var(--bg-soft); }
  .toc-inline summary { cursor: pointer; font-weight: 700; }
  .toc-inline ol { margin: 10px 0 0; padding-left: 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .nav-toggle { display: inline-block; margin-left: auto; }
  .primary-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 16px 16px; margin: 0; }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; align-items: stretch; }
  .header-tools { margin-left: 0; }
  body { font-size: 16.5px; }
  .entry { font-size: 17px; }
  .entry h2 { font-size: 24px; }
  .hero { padding: 44px 0 40px; }
  .hero .btn-ghost { margin: 10px 0 0; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .brand small { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .card { transition: none; } }
@media print { .notice-bar, .site-header, .toc, .site-footer, .search-form { display: none; } }

.more-in { margin-top: 48px; padding-top: 8px; border-top: 1px solid var(--line); }
.more-in h2 { font: 700 24px/1.25 var(--font-head); margin: 24px 0 16px; }
.more-in .grid { grid-template-columns: 1fr; }
.more-in p { margin-top: 20px; }

.site-footer li a, .crumbs a, .subhubs a, .pagination a { display: inline-block; padding: 4px 0; min-height: 24px; }
.subhubs a, .pagination a { padding: 7px 14px; }
.toc a { min-height: 24px; }

.contact-form textarea, .contact-form input[type=email] { padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.contact-form label { font-weight: 600; }
.form-note { color: var(--muted); font-size: 15px; }
.form-note.ok { color: var(--brand-dark); font-weight: 600; }

/* tools */
.tool { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 1.6em 0; }
.tool label { font-weight: 600; }
.tool input[type=date], .tool input[type=text], .tool select { width: 100%; max-width: 420px; padding: 11px 14px; border: 1px solid #9fb0ba; border-radius: 8px; font: inherit; background: #fff; }
.tool-result { margin-top: 12px; border-left: 4px solid var(--brand); background: #fff; padding: 4px 18px; border-radius: 0 var(--radius) var(--radius) 0; display: none; }
.tool-result:not(:empty) { display: block; }
.tool-main { font-weight: 600; }
.tool-error { color: #8a1c1c; font-weight: 600; }
.form-note { color: var(--muted); font-size: 14.5px; }

/* RTL (Hebrew, Arabic) */
.rtl .entry th, .rtl .entry td { text-align: right; }
.rtl .crumbs li + li::before { content: "\2039"; }
.rtl .quick-box { border-left: 0; border-right: 4px solid var(--brand); border-radius: var(--radius) 0 0 var(--radius); }
.rtl .toc { border-left: 0; border-right: 2px solid var(--line); padding-left: 0; padding-right: 18px; }
.rtl .tool-result { border-left: 0; border-right: 4px solid var(--brand); border-radius: var(--radius) 0 0 var(--radius); }
.rtl .primary-nav { margin-left: 0; margin-right: auto; }
.rtl .lang ul { right: auto; left: 0; }
.rtl .entry, .rtl .entry h1, .rtl .entry h2 { text-align: right; }
.rtl .entry ul, .rtl .entry ol { padding-left: 0; padding-right: 1.4em; }

/* language switcher */
.lang summary { display: inline-flex; align-items: center; gap: 6px; }
.lang a[aria-current] { background: var(--brand-tint); font-weight: 700; }
.lang ul { max-height: 70vh; overflow-y: auto; }
.footer-langs { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 28px; padding-top: 20px; border-top: 1px solid #243643; }
.footer-langs a { display: inline-block; padding: 4px 0; color: #e6eef2; }
.footer-langs a[aria-current] { font-weight: 700; text-decoration: none; color: #fff; border-bottom: 2px solid #8fcdb9; }
