/*
 Theme Name:   TweetGift (GeneratePress Child)
 Theme URI:    https://tweetgift.com
 Description:  TweetGift brand layer on top of GeneratePress: colors, type, buttons and landing page sections.
 Author:       TweetGift
 Template:     generatepress
 Version:      1.2.4
 Text Domain:  tweetgift
*/

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: "Outfit";
  src: url("fonts/outfit-latin.woff2") format("woff2");
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Brand tokens ---------- */
:root {
  --tg-violet: #5B3DF5;      /* brand, primary buttons, links */
  --tg-violet-dark: #4528D9; /* hover */
  --tg-night: #14111F;       /* text, dark sections */
  --tg-pink: #FF7AB8;        /* ribbon accent, secondary buttons on dark */
  --tg-lilac: #EEEAFF;       /* soft surfaces */
  --tg-soft-violet: #8E7BFF; /* violet on dark backgrounds */
  --tg-white: #FFFFFF;
  --tg-muted: #4A4660;       /* secondary text (passes 4.5:1 on white and lilac) */
  --tg-line: #E6E2F5;

  --tg-font-display: "Outfit", "Inter", system-ui, sans-serif;
  --tg-font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --tg-radius-panel: 20px;
  --tg-radius-button: 12px;
  --tg-content: 1120px;
  --tg-narrow: 720px;
  --tg-gutter: clamp(20px, 5vw, 40px);
  --tg-section-space: clamp(56px, 7vw, 96px);
}

/* ---------- Base (overrides GeneratePress defaults) ---------- */
body {
  font-family: var(--tg-font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--tg-night);
  background: var(--tg-white);
}
h1, h2, h3, h4, .site-title, .main-title {
  font-family: var(--tg-font-display);
  color: var(--tg-night);
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(40px, 6vw, 64px); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; }
h2 { font-size: clamp(30px, 4vw, 42px); font-weight: 700; line-height: 1.12; }
h3 { font-size: clamp(22px, 2.4vw, 26px); font-weight: 600; line-height: 1.25; }
h4 { font-size: 20px; font-weight: 600; }

a { color: var(--tg-violet); text-underline-offset: 3px; }
a:hover, a:focus { color: var(--tg-violet-dark); }
:focus-visible { outline: 3px solid var(--tg-violet); outline-offset: 3px; border-radius: 4px; }

::selection { background: var(--tg-lilac); color: var(--tg-night); }

/* Header logo: upload tweetgift-logo-header.png in the Customizer. Its size is fixed here so it never overflows on phones. */
.site-logo img, .site-header .header-image { height: auto; width: 190px; max-width: 100%; }
@media (max-width: 768px) {
  .site-logo img, .site-header .header-image { width: 150px; }
}

/* ---------- Buttons: block buttons and GeneratePress buttons ---------- */
/* GeneratePress prints inline rules like "a.wp-block-button__link:not(.has-background)"
   and "html input[type=button]", so these selectors are deliberately a step more specific. */
.wp-block-button__link,
.wp-block-buttons > .wp-block-button > a.wp-block-button__link,
.button, a.button, button, html input[type="submit"], html input[type="button"], html input[type="reset"] {
  font-family: var(--tg-font-body);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  min-height: 48px;
  padding: 14px 24px;
  border-radius: var(--tg-radius-button);
  background: var(--tg-violet);
  color: var(--tg-white);
  border: 2px solid var(--tg-violet);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.wp-block-button__link:hover, .wp-block-button__link:focus,
.wp-block-buttons > .wp-block-button > a.wp-block-button__link:hover,
.wp-block-buttons > .wp-block-button > a.wp-block-button__link:focus,
.button:hover, a.button:hover, button:hover, html input[type="submit"]:hover, html input[type="button"]:hover {
  background: var(--tg-violet-dark);
  border-color: var(--tg-violet-dark);
  color: var(--tg-white);
}
/* Outline style ("Outline" in the block's Styles panel) */
.wp-block-button.is-style-outline > .wp-block-button__link,
.wp-block-buttons > .wp-block-button.is-style-outline > a.wp-block-button__link {
  background: transparent;
  color: var(--tg-violet);
  border-color: var(--tg-violet);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover,
.wp-block-buttons > .wp-block-button.is-style-outline > a.wp-block-button__link:hover {
  background: var(--tg-lilac);
  border-color: var(--tg-violet);
  color: var(--tg-violet-dark);
}
/* Pink button: add the class "tg-button-pink" to the Button block */
.wp-block-button.tg-button-pink > .wp-block-button__link,
.wp-block-buttons > .wp-block-button.tg-button-pink > a.wp-block-button__link {
  background: var(--tg-pink);
  border-color: var(--tg-pink);
  color: var(--tg-night);
}
.wp-block-button.tg-button-pink > .wp-block-button__link:hover,
.wp-block-buttons > .wp-block-button.tg-button-pink > a.wp-block-button__link:hover {
  color: var(--tg-night);
  background: #FF94C6;
  border-color: #FF94C6;
}

/* ---------- Landing page sections ---------- */
/* Each section is a full-width Group block with one of these classes and
   the default (flow) layout. Content sits in a left-aligned 1120px column.

   GeneratePress is a classic theme, so WordPress wraps every Group's content in
   .wp-block-group__inner-container. Child rules therefore target both
   ".tg-x > *" and ".tg-x > .wp-block-group__inner-container > *". */
.tg-hero, .tg-section, .tg-section-alt, .tg-cta, .tg-faq {
  padding-top: var(--tg-section-space);
  padding-bottom: var(--tg-section-space);
  padding-left: max(var(--tg-gutter), calc((100% - var(--tg-content)) / 2));
  padding-right: max(var(--tg-gutter), calc((100% - var(--tg-content)) / 2));
  margin: 0;
  box-sizing: border-box;
}
:is(.tg-hero, .tg-section, .tg-section-alt, .tg-cta, .tg-faq) > *,
:is(.tg-hero, .tg-section, .tg-section-alt, .tg-cta, .tg-faq) > .wp-block-group__inner-container > * {
  margin-top: 0;
  margin-bottom: 0;
}
:is(.tg-hero, .tg-section, .tg-section-alt, .tg-cta, .tg-faq) > * + *,
:is(.tg-hero, .tg-section, .tg-section-alt, .tg-cta, .tg-faq) > .wp-block-group__inner-container > * + * {
  margin-top: 20px;
}
/* GeneratePress pads that wrapper (40px, 30px on phones) and caps it at 1200px; sections do their own spacing. */
.site-main :is(.tg-hero, .tg-section, .tg-section-alt, .tg-cta, .tg-faq, .tg-tool) > .wp-block-group__inner-container {
  padding: 0;
  max-width: none;
  margin: 0;
}
/* More room before the "main" piece of a section: grids, steps, images, columns, buttons */
:is(.tg-section, .tg-section-alt, .tg-cta) > * + :is(.wp-block-list, .wp-block-columns, .wp-block-image, .wp-block-buttons, .tg-tool),
:is(.tg-section, .tg-section-alt, .tg-cta) > .wp-block-group__inner-container > * + :is(.wp-block-list, .wp-block-columns, .wp-block-image, .wp-block-buttons, .tg-tool) {
  margin-top: 40px;
}
/* Inside columns, drop the theme's bottom margin on the last item */
:is(.tg-hero, .tg-section, .tg-section-alt, .tg-cta) .wp-block-column > :first-child { margin-top: 0; }
:is(.tg-hero, .tg-section, .tg-section-alt, .tg-cta) .wp-block-column > :last-child { margin-bottom: 0; }
:is(.tg-hero, .tg-section, .tg-section-alt, .tg-cta) .wp-block-columns { gap: clamp(32px, 5vw, 64px); margin-bottom: 0; }

/* Section intro paragraphs stay readable */
:is(.tg-section, .tg-section-alt) > p,
:is(.tg-section, .tg-section-alt) > .wp-block-group__inner-container > p { max-width: 68ch; color: var(--tg-muted); }
:is(.tg-section, .tg-section-alt) .wp-block-column > p { color: var(--tg-muted); }

/* Hero: the one bold moment on each page */
.tg-hero {
  background: var(--tg-lilac);
  padding-top: clamp(56px, 8vw, 104px);
}
.tg-hero h1 { max-width: 16ch; margin-bottom: 0; font-size: clamp(38px, 4.4vw, 58px); }
.tg-hero p { max-width: 56ch; font-size: clamp(18px, 1.6vw, 21px); color: var(--tg-muted); margin: 20px 0 0; }
.tg-hero .wp-block-buttons { margin-top: 32px; gap: 12px; }
.tg-hero .wp-block-image { margin: 0; }
/* Hero: the visual gets more room than the text on desktop, and bleeds a little past the column edge */
@media (min-width: 782px) {
  .tg-hero .wp-block-columns { gap: clamp(24px, 3vw, 48px); }
  .tg-hero .wp-block-columns > .wp-block-column:first-child { flex-grow: 1; }
  .tg-hero .wp-block-columns > .wp-block-column:last-child { flex-grow: 1.7; }
  .tg-hero .wp-block-column:last-child .wp-block-image { margin-right: calc(var(--tg-gutter) * -0.5); }
}
/* Hero visuals are transparent PNG/WebP with their own shadow, so no frame or radius here */
.tg-hero .wp-block-image img { box-shadow: none; border-radius: 0; }

.tg-section { background: var(--tg-white); }
.tg-section-alt { background: var(--tg-lilac); }

/* The free tool or picker sits in a quiet white panel */
.tg-tool {
  background: var(--tg-white);
  border: 1px solid var(--tg-line);
  border-radius: var(--tg-radius-panel);
  padding: clamp(20px, 3vw, 36px);
}

/* Closing call to action: dark, with the pink button */
.tg-cta {
  background: var(--tg-night);
  color: var(--tg-white);
  text-align: center;
}
.tg-cta h2, .tg-cta h3 { color: var(--tg-white); max-width: 22ch; margin-left: auto; margin-right: auto; }
.tg-cta p { color: #CFCAE6; max-width: 56ch; margin-left: auto; margin-right: auto; }
.tg-cta a:not(.wp-block-button__link) { color: var(--tg-soft-violet); }
.tg-cta .wp-block-buttons { justify-content: center; margin-top: 28px; }

/* FAQ: Details blocks */
.tg-faq details {
  max-width: var(--tg-narrow);
  border-bottom: 1px solid var(--tg-line);
  padding: 0;
  margin: 0;
}
.tg-faq details + details { margin-top: 0; }
.tg-faq > h2, .tg-faq > .wp-block-group__inner-container > h2 { max-width: var(--tg-narrow); margin-bottom: 12px; }
.tg-faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  padding: 20px 0;
  font-family: var(--tg-font-display);
  font-size: 20px;
  font-weight: 600;
}
.tg-faq summary::-webkit-details-marker { display: none; }
.tg-faq summary::after {
  content: "+";
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  color: var(--tg-violet);
  flex-shrink: 0;
}
.tg-faq details[open] summary::after { content: "\2212"; }
.tg-faq details > :not(summary) { margin: 0 0 20px; color: var(--tg-muted); max-width: 62ch; }

/* Lists in sections: no theme indent */
:is(.tg-hero, .tg-section, .tg-section-alt, .tg-faq, .tg-cta) .wp-block-list { margin-left: 0; }

/* Ordered lists inside sections read as step cards */
.tg-section ol.wp-block-list, .tg-section-alt ol.wp-block-list {
  counter-reset: tg-step;
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.tg-section ol.wp-block-list > li, .tg-section-alt ol.wp-block-list > li {
  counter-increment: tg-step;
  margin: 0;
  padding: 28px;
  border-radius: var(--tg-radius-panel);
  background: var(--tg-lilac);
  color: var(--tg-muted);
}
.tg-section-alt ol.wp-block-list > li { background: var(--tg-white); }
.tg-section ol.wp-block-list > li strong, .tg-section-alt ol.wp-block-list > li strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--tg-font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--tg-night);
}
.tg-section ol.wp-block-list > li::before, .tg-section-alt ol.wp-block-list > li::before {
  content: counter(tg-step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--tg-violet);
  color: var(--tg-white);
  font-family: var(--tg-font-display);
  font-weight: 700;
}

/* Link grid: add the class "tg-link-grid" to a List block of links.
   Each item becomes a clickable card. Lilac cards on white sections, white on lilac. */
ul.tg-link-grid {
  list-style: none;
  padding: 0;
  margin-left: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
ul.tg-link-grid > li { margin: 0; }
/* Compact variant for short lists (e.g. five platforms in one row): "tg-link-grid tg-link-grid-compact" */
ul.tg-link-grid.tg-link-grid-compact { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
ul.tg-link-grid > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  height: 100%;
  box-sizing: border-box;
  padding: 18px 22px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--tg-lilac);
  color: var(--tg-night);
  font-family: var(--tg-font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.tg-section-alt ul.tg-link-grid > li > a { background: var(--tg-white); border-color: var(--tg-line); }
ul.tg-link-grid > li > a::after { content: "\2192"; color: var(--tg-violet); flex-shrink: 0; }
ul.tg-link-grid > li > a:hover, ul.tg-link-grid > li > a:focus-visible { border-color: var(--tg-violet); color: var(--tg-violet); }

/* Cards: add the class "tg-cards" to a Columns block. Each column becomes a panel. */
.wp-block-columns.tg-cards { gap: 16px; }
.wp-block-columns.tg-cards > .wp-block-column {
  padding: 28px;
  border-radius: var(--tg-radius-panel);
  background: var(--tg-lilac);
}
.tg-section-alt .wp-block-columns.tg-cards > .wp-block-column { background: var(--tg-white); }
.wp-block-columns.tg-cards h3 { font-size: 22px; margin: 0; }
.wp-block-columns.tg-cards p { margin: 0; }
.wp-block-columns.tg-cards p strong + br { display: none; }
.wp-block-columns.tg-cards p strong { display: block; margin-bottom: 8px; font-family: var(--tg-font-display); font-size: 24px; color: var(--tg-night); }

/* Feature rows: stacked Columns blocks (text | image). Add "tg-reverse" to flip a row on desktop. */
:is(.tg-section, .tg-section-alt) .wp-block-columns + .wp-block-columns:not(.tg-cards) { margin-top: clamp(48px, 7vw, 88px); }
:is(.tg-section, .tg-section-alt) .wp-block-columns.tg-cards + .wp-block-columns.tg-cards { margin-top: 16px; }
@media (min-width: 782px) {
  .wp-block-columns.tg-reverse { flex-direction: row-reverse; }
}
:is(.tg-section, .tg-section-alt) .wp-block-column h3 + p { margin-top: 12px; }

/* Cards hold a stack: heading, text, list, buttons. Buttons sit at the bottom so a row lines up. */
.wp-block-columns.tg-cards > .wp-block-column { display: flex; flex-direction: column; }
.wp-block-columns.tg-cards > .wp-block-column > * + * { margin-top: 12px; }
.wp-block-columns.tg-cards > .wp-block-column > .wp-block-buttons { margin-top: auto; padding-top: 24px; }
.wp-block-columns.tg-cards > .wp-block-column > .wp-block-buttons .wp-block-button { width: 100%; }
.wp-block-columns.tg-cards > .wp-block-column > .wp-block-buttons .wp-block-button__link { width: 100%; }
.wp-block-columns.tg-cards > .wp-block-column > ul.wp-block-list { list-style: none; padding: 0; margin: 20px 0 0; }
.wp-block-columns.tg-cards ul.wp-block-list > li { position: relative; padding-left: 26px; margin: 0 0 8px; color: var(--tg-night); font-size: 15px; }
.wp-block-columns.tg-cards ul.wp-block-list > li::before {
  content: ""; position: absolute; left: 2px; top: 0.45em; width: 12px; height: 7px;
  border-left: 2px solid var(--tg-violet); border-bottom: 2px solid var(--tg-violet); transform: rotate(-45deg);
}
/* Plan prices: "<strong>$19</strong>per month" */
.wp-block-columns.tg-plans h3 + p { line-height: 1.2; margin-top: 16px; }
.wp-block-columns.tg-plans p strong { display: inline; font-size: 36px; margin: 0 8px 0 0; letter-spacing: -0.02em; }
.wp-block-columns.tg-plans h3 + p { color: var(--tg-muted); font-size: 15px; }

/* Testimonials: Columns with "tg-cards tg-testimonials". Real customer quotes only. */
.wp-block-columns.tg-testimonials > .wp-block-column > p:first-child { color: var(--tg-night); font-size: 18px; line-height: 1.55; }
.wp-block-columns.tg-testimonials > .wp-block-column > p:last-child { margin-top: auto; padding-top: 16px; font-size: 14px; }
.wp-block-columns.tg-testimonials p strong { display: block; font-size: 16px; margin: 0; }

/* Long text (policies, terms): add "tg-prose" as a second class on a section so headings get room above them. */
:is(.tg-section, .tg-section-alt).tg-prose > h2,
:is(.tg-section, .tg-section-alt).tg-prose > .wp-block-group__inner-container > h2 { margin-top: 44px; font-size: clamp(22px, 2.4vw, 28px); }
:is(.tg-section, .tg-section-alt).tg-prose > h2:first-child,
:is(.tg-section, .tg-section-alt).tg-prose > .wp-block-group__inner-container > h2:first-child { margin-top: 0; }
:is(.tg-section, .tg-section-alt).tg-prose .wp-block-list { max-width: 68ch; padding-left: 1.25em; }
:is(.tg-section, .tg-section-alt).tg-prose .wp-block-list li { margin-bottom: 6px; color: var(--tg-muted); }

/* Images inside sections */
:is(.tg-hero, .tg-section, .tg-section-alt) .wp-block-image { margin-bottom: 0; }
:is(.tg-hero, .tg-section, .tg-section-alt) .wp-block-image img { border-radius: var(--tg-radius-panel); }
/* App screenshots are transparent WebP with their own shadow: add the class "tg-app-shot" to the Image block */
.wp-block-image.tg-app-shot img { border-radius: 0; box-shadow: none; }

/* Landing pages start with their own hero, so GeneratePress's featured-image banner is hidden.
   functions.php also stops it being output; this is a fallback. */
.page.full-width-content .featured-image.page-header-image { display: none; }

/* ---------- Blog posts ---------- */
.single .entry-content { max-width: var(--tg-narrow); margin-left: auto; margin-right: auto; }
.single .entry-content > p, .single .entry-content li { font-size: 18px; line-height: 1.7; }
.entry-content blockquote {
  border-left: 0;
  background: var(--tg-lilac);
  border-radius: var(--tg-radius-panel);
  padding: 24px 28px;
  font-size: 20px;
}

/* ---------- Footer ---------- */
.site-footer, .site-info { background: var(--tg-night); color: #CFCAE6; }
.site-info a { color: var(--tg-white); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
