/*
Theme Name: KadePotha
Theme URI: https://kadepotha.com
Author: Nextl360 LLC
Author URI: https://nextl360.com
Description: The website for KadePotha, the shop's book on your phone: sales, stock, credit and suppliers for Sri Lankan shops. Fonts are bundled with the theme, so no visitor is sent to a third party.
Version: 1.0.0
Requires at least: 6.2
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: kadepotha
*/

/* ---- typefaces (bundled; all SIL Open Font License) ------------------------------------------- */
@font-face { font-family: "Baloo 2"; font-weight: 600; font-style: normal; font-display: swap; src: url("assets/fonts/baloo-2-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Baloo 2"; font-weight: 700; font-style: normal; font-display: swap; src: url("assets/fonts/baloo-2-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 400; font-style: normal; font-display: swap; src: url("assets/fonts/figtree-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-style: normal; font-display: swap; src: url("assets/fonts/figtree-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Caveat"; font-weight: 500; font-style: normal; font-display: swap; src: url("assets/fonts/caveat-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Abhaya Libre"; font-weight: 500; font-style: normal; font-display: swap; src: url("assets/fonts/abhaya-libre-sinhala-500-normal.woff2") format("woff2"); unicode-range: U+0D80-0DFF, U+200C-200D, U+25CC; }

/* ---- tokens ------------------------------------------------------------------------------------ */
:root {
  --lagoon: #12606e;        /* the app's own colour */
  --lagoon-deep: #0b3f49;
  --marigold: #f5b301;      /* the book's gold cover */
  --ground: #f5f9f8;
  --surface: #ffffff;
  --paper: #fbf6e9;         /* a ledger page */
  --rule: #c7dadd;          /* its ruled lines */
  --margin: #d9655b;        /* its red margin line */
  --ink: #14323a;
  --ink-soft: #40595f;
  --line: #d9e5e6;

  --display: "Baloo 2", "Figtree", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat", "Segoe Script", cursive;
  --sinhala: "Abhaya Libre", "Noto Serif Sinhala", "Iskoola Pota", serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.6875rem;
  --step-3: 2.125rem;
  --step-4: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem);

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); font-size: var(--step-0); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.08; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--lagoon); text-underline-offset: 0.18em; }
a:hover { color: var(--lagoon-deep); }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; left: 1rem; top: 1rem; width: auto; height: auto; clip-path: none; z-index: 100; background: var(--surface); padding: 0.6rem 1rem; }
[lang="si"] { font-family: var(--sinhala); }

/* ---- buttons ----------------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 3rem; padding: 0.55rem 1.4rem; border-radius: 0.75rem; border: 2px solid transparent; font: 600 var(--step-0)/1.2 var(--body); text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--marigold); color: var(--ink); }
.btn-primary:hover { background: #ffc61f; color: var(--ink); }
.btn-quiet { background: transparent; color: var(--lagoon-deep); border-color: var(--lagoon); }
.btn-quiet:hover { background: var(--lagoon); color: #fff; }
.on-dark .btn-quiet { color: #fff; border-color: rgba(255, 255, 255, 0.6); }
.on-dark .btn-quiet:hover { background: #fff; color: var(--lagoon-deep); }

/* ---- header ------------------------------------------------------------------------------------ */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 4.5rem; flex-wrap: wrap; padding-block: 0.6rem; }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; color: var(--lagoon); font: 700 1.75rem/1 var(--display); letter-spacing: -0.01em; }
.brand img { width: 2.25rem; height: auto; display: block; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1.6rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 600; padding: 0.5rem 0; display: inline-block; }
.site-nav a:hover { color: var(--lagoon); text-decoration: underline; }
.site-header .btn { min-height: 2.75rem; }

/* ---- hero: the paper book beside the phone ------------------------------------------------------ */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; padding-block: clamp(3rem, 7vw, 6rem); }
.hero-name { font-size: var(--step-3); color: var(--lagoon); line-height: 1.2; margin-bottom: 0.5rem; }
.hero h1 { font-size: var(--step-4); }
.hero-lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink-soft); margin-top: 1.25rem; max-width: 32ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.hero-note { margin-top: 1.25rem; font-size: var(--step--1); color: var(--ink-soft); }

.scene { position: relative; min-height: 31rem; }
.ledger { position: absolute; left: 0; top: 0.5rem; width: min(25rem, 86%); padding: 1.6rem 1.4rem 2rem 3.6rem; background: var(--paper); border-radius: 4px 12px 12px 4px; transform: rotate(-3.5deg); box-shadow: 0 1px 0 #e9dfc6, 0 22px 44px rgba(11, 63, 73, 0.18);
  background-image: linear-gradient(90deg, transparent 2.75rem, var(--margin) 2.75rem, var(--margin) calc(2.75rem + 1.5px), transparent calc(2.75rem + 1.5px)), repeating-linear-gradient(180deg, transparent 0, transparent 2.15rem, var(--rule) 2.15rem, var(--rule) calc(2.15rem + 1px)); }
.ledger-title { font: 500 1.6rem/2.15rem var(--hand); color: #2b4d7a; }
.ledger ul { list-style: none; margin: 0; padding: 0; font: 500 1.45rem/2.15rem var(--hand); color: #2b4d7a; }
.ledger li { display: flex; justify-content: space-between; gap: 1rem; white-space: nowrap; }
.ledger li.done { color: #7c8ea4; text-decoration: line-through; text-decoration-thickness: 1.5px; }
.ledger li.sum { color: #a23b33; }

.phone { position: absolute; right: 0; bottom: 0; width: min(15.5rem, 58%); background: #0e2a31; border-radius: 2rem; padding: 0.6rem; transform: rotate(2.5deg); box-shadow: 0 30px 60px rgba(11, 63, 73, 0.35); }
.phone-screen { background: var(--ground); border-radius: 1.5rem; padding: 1.1rem 0.85rem 0.9rem; font-size: 0.8rem; line-height: 1.35; color: var(--ink); }
.phone-hello { color: var(--ink-soft); font-size: 0.72rem; }
.phone-shop { font: 700 1.05rem/1.2 var(--display); }
.phone-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; margin-top: 0.7rem; }
.phone-tile { background: #fff; border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.5rem 0.55rem; }
.phone-tile span { display: block; color: var(--ink-soft); font-size: 0.66rem; }
.phone-tile b { font-size: 0.82rem; white-space: nowrap; }
.phone-list { background: #fff; border: 1px solid var(--line); border-radius: 0.6rem; margin-top: 0.5rem; }
.phone-list div { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.42rem 0.55rem; border-bottom: 1px solid var(--line); }
.phone-list div:last-child { border-bottom: 0; }
.phone-list b { white-space: nowrap; }
.phone-list .owes { color: #a23b33; }
.phone-bar { display: flex; justify-content: space-around; margin-top: 0.7rem; padding-top: 0.55rem; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.66rem; }
.phone-bar .on { color: var(--lagoon); font-weight: 600; }

/* ---- sections ---------------------------------------------------------------------------------- */
.section { padding-block: clamp(3.5rem, 7vw, 6rem); }
.section-head { max-width: 40rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { font-size: var(--step-3); }
.section-head p { margin-top: 0.9rem; color: var(--ink-soft); font-size: var(--step-1); line-height: 1.5; }

/* three questions the paper book answers: set out like ledger columns, closed with a total line */
.columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); }
.columns > div { padding: 1.6rem 1.75rem 1.9rem; border-left: 1px solid var(--rule); }
.columns > div:first-child { border-left: 0; padding-left: 0; }
.columns h3 { font-size: var(--step-2); color: var(--lagoon-deep); }
.columns p { margin-top: 0.6rem; color: var(--ink-soft); }

/* what it does: rows, as in a book */
.features { background: var(--surface); border-block: 1px solid var(--line); }
.rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(2rem, 5vw, 4.5rem); margin: 0; }
.rows > div { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: 0.2rem 1rem; padding: 1.35rem 0; border-top: 1px solid var(--line); }
.rows svg { grid-row: span 2; width: 2rem; height: 2rem; color: var(--lagoon); margin-top: 0.15rem; }
.rows dt { font: 700 var(--step-1)/1.25 var(--display); }
.rows dd { margin: 0; color: var(--ink-soft); grid-column: 2; }

/* who uses it */
.roles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
.role { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--lagoon); border-radius: 0 0 0.75rem 0.75rem; padding: 1.4rem 1.3rem 1.5rem; }
.role:nth-child(even) { border-top-color: var(--marigold); }
.role h3 { font-size: var(--step-1); }
.role ul { margin: 0.8rem 0 0; padding-left: 1.1rem; color: var(--ink-soft); }
.role li { margin-top: 0.3rem; }

/* languages and offline */
.band { background: var(--lagoon-deep); color: #e4f0f1; }
.band .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.band .band-name { margin: 0; font: 500 clamp(3.25rem, 2rem + 6vw, 6rem)/1.15 var(--sinhala); color: #fff; }
.band .band-name span { color: var(--marigold); }
.band h2 { font-size: var(--step-3); color: #fff; }
.band p { margin-top: 0.9rem; font-size: var(--step-1); line-height: 1.5; }
.band ul { margin: 1.4rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.6rem; }
.band li { padding-left: 1.5rem; position: relative; }
.band li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 0.7rem; height: 0.7rem; background: var(--marigold); border-radius: 2px; transform: rotate(45deg); }

/* trust */
.trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
.trust h3 { font-size: var(--step-1); }
.trust p { margin-top: 0.5rem; color: var(--ink-soft); }

/* closing call */
.closing { background: var(--marigold); color: var(--ink); }
.closing .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.closing h2 { font-size: var(--step-3); max-width: 22ch; }
.closing p { margin-top: 0.6rem; font-size: var(--step-1); max-width: 34ch; }
.closing .btn { background: var(--lagoon-deep); color: #fff; }
.closing .btn:hover { background: var(--ink); color: #fff; }

/* ---- footer ------------------------------------------------------------------------------------ */
.site-footer { background: #072c33; color: #c4d9db; padding-block: 3rem 2.25rem; font-size: var(--step--1); }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 2rem; }
.site-footer .brand { color: #fff; }
.site-footer p { margin-top: 0.9rem; max-width: 34ch; }
.site-footer h2 { font: 600 var(--step-0)/1.3 var(--body); color: #fff; letter-spacing: 0; }
.site-footer ul { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.site-footer a { color: #e4f0f1; }
.site-footer a:hover { color: #fff; }
.site-footer .legal { max-width: none; grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, 0.16); padding-top: 1.25rem; margin-top: 0.5rem; }

/* ---- ordinary pages (privacy policy, delete account, posts) ------------------------------------- */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding-block: clamp(2.5rem, 5vw, 4rem); }
.page-head h1 { font-size: var(--step-4); }
.page-head p { margin-top: 0.75rem; color: var(--ink-soft); font-size: var(--step-1); }
.prose { max-width: 42rem; padding-block: clamp(2.5rem, 5vw, 4rem); }
.prose > * + * { margin-top: 1.1rem; }
.prose h2 { font-size: var(--step-2); margin-top: 2.5rem; }
.prose h3 { font-size: var(--step-1); margin-top: 1.8rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: 0.4rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.7rem 0.8rem 0.7rem 0; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; border-bottom-color: var(--ink); }
.table-scroll { overflow-x: auto; }

.notice { border-left: 4px solid var(--lagoon); background: var(--surface); padding: 1rem 1.2rem; border-radius: 0 0.5rem 0.5rem 0; }
.notice.ok { border-left-color: #2f8f5b; }
.notice.bad { border-left-color: var(--margin); }

.form { display: grid; gap: 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 0.75rem; padding: clamp(1.25rem, 3vw, 2rem); margin-top: 2rem; }
.form label { display: grid; gap: 0.35rem; font-weight: 600; }
.form small { font-weight: 400; color: var(--ink-soft); }
.form input[type="text"], .form input[type="email"], .form input[type="tel"], .form textarea { font: inherit; font-weight: 400; color: var(--ink); width: 100%; min-height: 3rem; padding: 0.6rem 0.8rem; border: 1.5px solid #9db4b8; border-radius: 0.6rem; background: #fff; }
.form textarea { min-height: 7rem; resize: vertical; }
.form .check { display: flex; align-items: flex-start; gap: 0.6rem; font-weight: 400; }
.form .check input { width: 1.2rem; height: 1.2rem; margin-top: 0.2rem; flex: none; }
.form .trap { position: absolute; left: -9999px; }
.form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.form legend { font-weight: 600; padding: 0; margin-bottom: 0.4rem; }

/* ---- smaller screens --------------------------------------------------------------------------- */
@media (max-width: 62rem) {
  .hero .wrap, .band .wrap { grid-template-columns: minmax(0, 1fr); }
  .scene { min-height: 29rem; max-width: 30rem; }
  .roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer .wrap > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 44rem) {
  .site-header .wrap { gap: 0.4rem 1rem; }
  .site-header .btn { margin-left: auto; order: 2; }
  .site-nav { margin-left: 0; width: 100%; order: 3; }
  .site-nav ul { gap: 0.2rem 1.2rem; }
  .columns { grid-template-columns: minmax(0, 1fr); }
  .columns > div { border-left: 0; border-top: 1px solid var(--rule); padding-inline: 0; }
  .columns > div:first-child { border-top: 0; }
  .rows, .trust { grid-template-columns: minmax(0, 1fr); }
  .roles { grid-template-columns: minmax(0, 1fr); }
  .scene { min-height: 27rem; }
  .ledger { padding-left: 3.2rem; }
  .ledger ul, .ledger-title { font-size: 1.25rem; }
  .hero-lede { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print { .site-header, .site-footer, .closing { display: none; } body { background: #fff; } }
