/*
Theme Name: Tableside Canvas
Theme URI: https://example.com/tableside
Author: Tableside
Author URI: https://example.com
Description: The Elementor-first edition of Tableside. On activation (or from Restaurants → Homepage Setup), a real WordPress Page called "Home page" is generated with the full homepage design written directly into it as native Elementor content — open it with "Edit with Elementor" and every section is already there, fully editable. Any other Page is a blank Elementor canvas too. The Restaurants custom post type, the QR-menu request form, and the WiFi popup are the only built-in PHP-rendered pieces, and even a restaurant page can be handed to Elementor per-restaurant. Requires Elementor (free).
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tableside-canvas
*/

/* ============================================================
   TABLESIDE — shared stylesheet
   Design tokens live at the top. Everything else is built on them.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,500;0,9..144,600;0,9..144,700;0,9..144,900;1,9..144,500;1,9..144,600&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root{
  /* ---- palette ---- */
  --ink:        #15130f;   /* page background — warm near-black */
  --ink-2:      #1b1811;   /* alternate section background */
  --panel:      #211d16;   /* card / ticket surface */
  --panel-2:    #2a251c;   /* hover surface */
  --brass:      #c9a25a;   /* primary accent — brass / candlelight */
  --brass-hi:   #e6c684;   /* brighter brass for hover / glow */
  --wine:       #8a4040;   /* secondary accent — used sparingly */
  --cream:      #f3ead9;   /* primary text on dark */
  --stone:      #a39c8c;   /* secondary / muted text */
  --stone-dim:  #746d5f;   /* tertiary text, captions */
  --line:       rgba(243,234,218,0.10);
  --line-strong:rgba(243,234,218,0.18);
  --shadow:     0 20px 60px -20px rgba(0,0,0,0.65);

  /* restaurant pages can override this at runtime */
  --accent: var(--brass);
  --accent-hi: var(--brass-hi);

  /* ---- type ---- */
  --font-display: 'Fraunces', ui-serif, Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;

  /* ---- misc ---- */
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.22,1,.36,1);
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
body{
  margin:0;
  background:var(--ink);
  color:var(--cream);
  font-family:var(--font-body);
  font-size:16px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
button{ font:inherit; color:inherit; background:none; border:none; cursor:pointer; }
ul{ margin:0; padding:0; list-style:none; }
h1,h2,h3,p{ margin:0; }

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration:0.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:0.001ms !important;
    scroll-behavior:auto !important;
  }
}

:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:3px;
  border-radius:6px;
}

/* faint paper-grain texture, used behind hero / cards */
.grain{ position:relative; isolation:isolate; }
.grain::before{
  content:"";
  position:absolute; inset:0;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events:none;
  z-index:0;
}

/* ============================================================
   Layout helpers
   ============================================================ */
.wrap{
  width:100%;
  max-width:1040px;
  margin:0 auto;
  padding:0 22px;
}
.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-family:var(--font-mono);
  font-size:0.72rem;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--accent);
}
.eyebrow::before{
  content:"";
  width:6px; height:6px;
  border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

/* ============================================================
   Buttons — base
   ============================================================ */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:15px 26px;
  border-radius:999px;
  font-family:var(--font-body);
  font-weight:600;
  font-size:0.95rem;
  letter-spacing:0.01em;
  transition:transform .35s var(--ease), box-shadow .35s var(--ease), background-color .25s var(--ease);
  white-space:nowrap;
}
.btn:active{ transform:scale(0.97); }
.btn-primary{
  background:linear-gradient(180deg, var(--accent-hi), var(--accent));
  color:#1a1509;
  box-shadow:0 10px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover{
  transform:translateY(-2px);
  box-shadow:0 16px 34px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}
.btn-ghost{
  background:transparent;
  color:var(--cream);
  border:1px solid var(--line-strong);
}
.btn-ghost:hover{
  border-color:var(--accent);
  color:var(--accent);
}

/* ============================================================
   TICKET — the signature component.
   A kitchen-order-ticket stub: notched left/right edges + a
   dashed perforation splitting the icon well from the label.
   Used for homepage feature cards AND restaurant action buttons.
   The two notch pseudo-elements must sit on a flat background
   matching --notch-bg (set per context) to read as "punched out."
   ============================================================ */
.ticket{
  --notch-bg: var(--ink);
  position:relative;
  display:flex;
  align-items:center;
  gap:16px;
  width:100%;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius-md);
  padding:18px 22px 18px 18px;
  text-align:left;
  cursor:pointer;
  transition:background-color .25s var(--ease), transform .3s var(--ease), border-color .25s var(--ease);
}
.ticket::before,
.ticket::after{
  content:"";
  position:absolute;
  top:50%;
  width:20px; height:20px;
  border-radius:50%;
  background:var(--notch-bg);
  transform:translateY(-50%);
  transition:background-color .25s var(--ease);
  z-index:1;
}
.ticket::before{ left:-10px; }
.ticket::after{ right:-10px; }

.ticket:hover, .ticket:focus-visible{
  background:var(--panel-2);
  border-color:var(--line-strong);
  transform:translateY(-3px);
}

.ticket__icon{
  flex:0 0 auto;
  width:46px; height:46px;
  border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  background:color-mix(in srgb, var(--accent) 16%, transparent);
  color:var(--accent);
  position:relative;
}
.ticket__icon svg{ width:22px; height:22px; }

.ticket__divider{
  align-self:stretch;
  width:0;
  border-left:1.5px dashed var(--line-strong);
  margin:2px 0;
  flex:0 0 auto;
}

.ticket__body{ flex:1 1 auto; min-width:0; }
.ticket__label{
  font-weight:600;
  font-size:1rem;
  color:var(--cream);
  display:block;
}
.ticket__hint{
  font-family:var(--font-mono);
  font-size:0.74rem;
  color:var(--stone-dim);
  letter-spacing:.03em;
  display:block;
  margin-top:2px;
}
.ticket__chevron{
  flex:0 0 auto;
  color:var(--stone-dim);
  transition:transform .3s var(--ease), color .25s var(--ease);
}
.ticket:hover .ticket__chevron{
  transform:translateX(3px);
  color:var(--accent);
}
.ticket__index{
  position:absolute;
  top:8px; right:16px;
  font-family:var(--font-mono);
  font-size:0.62rem;
  color:var(--stone-dim);
  letter-spacing:.04em;
}

/* ============================================================
   NAV (homepage)
   ============================================================ */
.nav{
  position:sticky;
  top:0;
  z-index:40;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 22px;
  background:color-mix(in srgb, var(--ink) 78%, transparent);
  backdrop-filter:blur(14px) saturate(140%);
  -webkit-backdrop-filter:blur(14px) saturate(140%);
  border-bottom:1px solid transparent;
  transition:border-color .3s var(--ease), padding .3s var(--ease);
}
.nav.is-scrolled{
  border-bottom-color:var(--line);
  padding:12px 22px;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-family:var(--font-display);
  font-weight:600;
  font-size:1.1rem;
  color:var(--cream);
}
.brand__mark{
  width:30px; height:30px;
  border-radius:9px;
  background:linear-gradient(160deg, var(--brass-hi), var(--brass) 70%);
  display:flex; align-items:center; justify-content:center;
  color:#1a1509;
}
.brand__mark svg{ width:16px; height:16px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer{
  border-top:1px solid var(--line);
  padding:40px 0 30px;
}
.site-footer__row{
  display:flex;
  flex-direction:column;
  gap:22px;
}
.site-footer__brand{
  font-family:var(--font-display);
  font-size:1.05rem;
}
.site-footer__links{
  display:flex;
  flex-wrap:wrap;
  gap:18px;
  font-size:0.88rem;
  color:var(--stone);
}
.site-footer__links a:hover{ color:var(--accent); }
.site-footer__legal{
  font-family:var(--font-mono);
  font-size:0.7rem;
  color:var(--stone-dim);
}

/* ============================================================
   Shared list/grid components — used by the restaurant directory
   (archive-restaurant.php) and the generic fallback template
   (index.php); NOT part of the homepage, which is Elementor's.
   ============================================================ */
.feature-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}
.feature-grid .ticket{ padding:22px 24px 22px 20px; }

.steps{
  display:grid;
  gap:0;
  border-top:1px solid var(--line);
}
.step{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:18px;
  padding:26px 0;
  border-bottom:1px solid var(--line);
}
.step__num{
  font-family:var(--font-mono);
  font-size:0.78rem;
  color:var(--accent);
  padding-top:3px;
}
.step h3{
  font-family:var(--font-display);
  font-size:1.15rem;
  font-weight:600;
  margin-bottom:6px;
}
.step p{ color:var(--stone); line-height:1.6; font-size:0.94rem; }

/* ============================================================
   RESTAURANT PAGE
   ============================================================ */
.r-page{
  min-height:100vh;
  position:relative;
  isolation:isolate;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:0 0 48px;
}
/* same warm ambient glow used behind the homepage hero, anchored
   behind the logo so the page reads as a continuation of it */
.r-page::before{
  content:"";
  position:absolute;
  top:-200px; left:50%;
  transform:translateX(-50%);
  width:640px; height:640px;
  background:radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, transparent), transparent 72%);
  filter:blur(6px);
  pointer-events:none;
  z-index:0;
}
.r-topbar, .r-card, .r-footer{ position:relative; z-index:1; }

.r-topbar{
  width:100%;
  display:flex;
  justify-content:center;
  padding:14px 0;
  font-family:var(--font-mono);
  font-size:0.68rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--stone-dim);
  border-bottom:1px solid var(--line);
}
.r-topbar a{ color:var(--stone); }
.r-topbar a:hover{ color:var(--accent); }

.r-card{
  width:100%;
  max-width:440px;
  padding:56px 32px 0;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
}

/* thin corner-frame around the identity block — the same bracket
   language as the buttons and the brand mark, dialed down to a
   quiet plaque rather than a loud UI element */
.r-frame{ position:absolute; width:20px; height:20px; border:1px solid var(--line-strong); opacity:0.85; }
.r-frame--tl{ top:14px; left:14px; border-right:none; border-bottom:none; }
.r-frame--tr{ top:14px; right:14px; border-left:none; border-bottom:none; }
.r-frame--bl{ bottom:14px; left:14px; border-right:none; border-top:none; }
.r-frame--br{ bottom:14px; right:14px; border-left:none; border-top:none; }

.r-logo{
  position:relative;
  width:108px; height:108px;
  border-radius:50%;
  background:linear-gradient(160deg, var(--accent-hi), var(--accent));
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display);
  font-weight:700;
  font-size:2.3rem;
  color:#1a1509;
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 0 0 9px color-mix(in srgb, var(--accent) 7%, transparent),
    0 20px 45px -16px color-mix(in srgb, var(--accent) 75%, transparent);
  overflow:hidden;
}
/* soft halo behind the logo — the one deliberately luxurious flourish */
.r-logo::before{
  content:"";
  position:absolute;
  inset:-26px;
  border-radius:50%;
  background:radial-gradient(circle, color-mix(in srgb, var(--accent) 38%, transparent), transparent 70%);
  filter:blur(16px);
  z-index:-1;
}
.r-logo img{ width:100%; height:100%; object-fit:cover; border-radius:50%; }

.r-name{
  font-family:var(--font-display);
  font-weight:600;
  font-size:clamp(1.85rem, 7vw, 2.3rem);
  margin-top:22px;
  letter-spacing:-0.01em;
}
.r-tagline{
  font-family:var(--font-mono);
  font-size:0.72rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--accent);
  margin-top:10px;
  display:inline-block;
}
/* short gold rule under the tagline — the same editorial accent
   used on the homepage feature headings */
.r-tagline::after{
  content:"";
  display:block;
  width:38px; height:1.5px;
  margin:14px auto 0;
  background:linear-gradient(90deg, transparent, var(--accent), transparent);
}
.r-welcome{
  color:var(--stone);
  margin-top:16px;
  line-height:1.6;
  max-width:36ch;
}

.r-actions{
  width:100%;
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-top:34px;
}

.r-social{
  display:flex;
  gap:12px;
  width:100%;
  margin-top:12px;
}
.r-social .btn-ghost{
  flex:1;
  padding:13px 18px;
  font-size:0.86rem;
}

.r-footer{
  margin-top:48px;
  padding-top:32px;
  border-top:1px solid var(--line);
  width:100%;
  max-width:440px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
}
.r-footer__qr{
  width:96px; height:96px;
  padding:8px;
  background:var(--cream);
  border-radius:14px;
  box-shadow:0 16px 34px -16px color-mix(in srgb, var(--accent) 60%, transparent);
}
.r-footer__qr img{ width:100%; height:100%; }
.r-footer__ticket-no{
  font-family:var(--font-mono);
  font-size:0.68rem;
  color:var(--stone-dim);
  letter-spacing:.06em;
}
.r-footer__powered{
  font-family:var(--font-mono);
  font-size:0.68rem;
  color:var(--stone-dim);
}
.r-footer__powered a{ color:var(--stone); border-bottom:1px dashed var(--line-strong); }
.r-footer__powered a:hover{ color:var(--accent); }

/* ============================================================
   WIFI MODAL — bottom sheet, receipt styling
   ============================================================ */
.sheet-backdrop{
  position:fixed; inset:0;
  background:rgba(10,9,6,0.7);
  backdrop-filter:blur(3px);
  opacity:0;
  pointer-events:none;
  transition:opacity .3s var(--ease);
  z-index:60;
}
.sheet-backdrop.is-open{ opacity:1; pointer-events:auto; }

.sheet{
  position:fixed;
  left:0; right:0; bottom:0;
  z-index:61;
  margin:0 auto;
  max-width:440px;
  background:var(--panel);
  border:1px solid var(--line-strong);
  border-bottom:none;
  border-radius:26px 26px 0 0;
  padding:14px 26px 32px;
  transform:translateY(110%);
  transition:transform .4s var(--ease);
  box-shadow:0 -20px 50px -10px rgba(0,0,0,0.6);
}
.sheet-backdrop.is-open .sheet{ transform:translateY(0); }

.sheet__grabber{
  width:40px; height:4px;
  border-radius:99px;
  background:var(--line-strong);
  margin:0 auto 18px;
}
.sheet__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:6px;
}
.sheet__head h3{
  font-family:var(--font-display);
  font-size:1.3rem;
  font-weight:600;
}
.sheet__close{
  width:32px; height:32px;
  border-radius:50%;
  background:var(--panel-2);
  display:flex; align-items:center; justify-content:center;
  color:var(--stone);
}
.sheet__close:hover{ color:var(--accent); }

.sheet__tear{
  height:0;
  border-top:1.5px dashed var(--line-strong);
  margin:18px 0;
  position:relative;
}
.sheet__tear::before,.sheet__tear::after{
  content:"";
  position:absolute; top:-9px;
  width:18px; height:18px; border-radius:50%;
  background:var(--ink);
}
.sheet__tear::before{ left:-26px; }
.sheet__tear::after{ right:-26px; }

.sheet__field{ margin-bottom:16px; }
.sheet__field label{
  display:block;
  font-family:var(--font-mono);
  font-size:0.68rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--stone-dim);
  margin-bottom:6px;
}
.sheet__value{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:var(--ink);
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  padding:14px 16px;
}
.sheet__value span{
  font-family:var(--font-mono);
  font-size:1.05rem;
  letter-spacing:.02em;
  word-break:break-all;
}
.sheet__copy{
  flex:0 0 auto;
  display:flex; align-items:center; gap:6px;
  background:color-mix(in srgb, var(--accent) 18%, transparent);
  color:var(--accent);
  padding:8px 12px;
  border-radius:99px;
  font-size:0.8rem;
  font-weight:600;
  transition:background-color .25s var(--ease), transform .2s var(--ease);
}
.sheet__copy:hover{ background:color-mix(in srgb, var(--accent) 28%, transparent); }
.sheet__copy.is-copied{ background:var(--accent); color:#1a1509; }
.sheet__copy svg{ width:14px; height:14px; }

.sheet__note{
  font-size:0.82rem;
  color:var(--stone-dim);
  line-height:1.5;
}

/* ============================================================
   TOAST (copy confirmation, fallback)
   ============================================================ */
.toast{
  position:fixed;
  left:50%; bottom:26px;
  transform:translate(-50%, 20px);
  background:var(--cream);
  color:var(--ink);
  padding:12px 20px;
  border-radius:99px;
  font-size:0.85rem;
  font-weight:600;
  opacity:0;
  pointer-events:none;
  transition:opacity .3s var(--ease), transform .3s var(--ease);
  z-index:80;
}
.toast.is-visible{
  opacity:1;
  transform:translate(-50%, 0);
}

/* ============================================================
   Reveal-on-scroll
   ============================================================ */
[data-reveal]{
  opacity:0;
  transform:translateY(18px);
  transition:opacity .7s var(--ease), transform .7s var(--ease);
}
[data-reveal].is-visible{
  opacity:1;
  transform:translateY(0);
}

/* ============================================================
   LEAD FORM — shares the WiFi popup's bottom-sheet chrome
   (.sheet-backdrop / .sheet / .sheet__tear already handle the
   open/close animation and the receipt-styled tear line)
   ============================================================ */
.sheet__form-field{ margin-bottom:16px; text-align:left; }
.sheet__form-field label{
  display:block;
  font-family:var(--font-mono);
  font-size:0.68rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--stone-dim);
  margin-bottom:6px;
}
.sheet__input{
  width:100%;
  background:var(--ink);
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  padding:14px 16px;
  font-family:var(--font-body);
  font-size:1rem;
  color:var(--cream);
  transition:border-color .25s var(--ease);
}
.sheet__input::placeholder{ color:var(--stone-dim); }
.sheet__input:focus{ outline:none; border-color:var(--accent); }

.sheet__submit{
  width:100%;
  margin-top:6px;
  padding:15px 22px;
  border-radius:999px;
  background:linear-gradient(180deg, var(--accent-hi), var(--accent));
  color:#1a1509;
  font-weight:600;
  font-size:0.95rem;
  transition:transform .3s var(--ease), opacity .25s var(--ease);
}
.sheet__submit:hover{ transform:translateY(-2px); }
.sheet__submit:disabled{ opacity:0.6; pointer-events:none; }

.sheet__form-error{
  color:#e07a6b;
  font-size:0.82rem;
  margin-top:10px;
  display:none;
}
.sheet__form-error.is-visible{ display:block; }

.sheet__success{
  display:none;
  flex-direction:column;
  align-items:center;
  text-align:center;
  padding:20px 0 6px;
}
.sheet__success.is-visible{ display:flex; }
.sheet__success-icon{
  width:52px; height:52px;
  border-radius:50%;
  background:color-mix(in srgb, var(--accent) 18%, transparent);
  color:var(--accent);
  display:flex; align-items:center; justify-content:center;
  margin-bottom:14px;
}
.sheet__success-icon svg{ width:24px; height:24px; }
.sheet__success h3{ font-family:var(--font-display); font-size:1.2rem; margin-bottom:8px; }
.sheet__success p{ color:var(--stone); font-size:0.9rem; max-width:32ch; }

/* ============================================================
   Responsive — tablet / desktop
   ============================================================ */
@media (min-width:640px){
  .feature-grid{ grid-template-columns:1fr 1fr; }
  .r-actions{ gap:14px; }
}

@media (min-width:900px){
  .wrap{ padding:0 32px; }
  .step{ grid-template-columns:80px 1fr; }
  .site-footer__row{ flex-direction:row; align-items:center; justify-content:space-between; }
}
