/**
 * Te Rento Una Web — Linktree Modules
 * Design tokens + presets for Linktree-style pages.
 *
 * Scope all rules under `.linktree-page` so we don't leak into other Divi pages.
 * Use [data-preset="..."] for preset switching.
 * Per-client overrides come via inline <style> generated by the deploy script.
 */

/* ============================================================
   TOKENS (defaults — overridden by presets below)
   ============================================================ */
.linktree-page {
  /* Layout */
  --lt-card-max-width: 480px;
  --lt-card-radius: 36px;
  --lt-card-padding: 16px;
  --lt-card-gap: 16px;

  /* Background */
  --lt-page-bg: #f5f5f5;
  --lt-card-bg: rgba(255, 255, 255, 0.6);

  /* Pill buttons */
  --lt-btn-bg: #ffffff;
  --lt-btn-radius: 36px;
  --lt-btn-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  --lt-btn-padding: 10px 16px;
  --lt-btn-gap: 12px;
  --lt-btn-border: 2px solid transparent;
  --lt-btn-icon-bg: #000000;
  --lt-btn-icon-color: #ffffff;
  --lt-btn-icon-size: 44px;
  --lt-btn-icon-radius: 50%;
  --lt-btn-title-color: #1c1c1c;
  --lt-btn-title-weight: 500;
  --lt-btn-title-size: 15px;
  --lt-btn-subtitle-color: #757575;
  --lt-btn-subtitle-size: 13px;

  /* Typography */
  --lt-font-display: 'Questrial', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --lt-font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --lt-name-size: 18px;
  --lt-name-weight: 500;
  --lt-name-color: #1c1c1c;
  --lt-bio-size: 14px;
  --lt-bio-weight: 300;
  --lt-bio-color: #5c5c5c;

  /* Social row */
  --lt-social-size: 22px;
  --lt-social-color: #000000;
  --lt-social-gap: 16px;
  --lt-social-highlight-border: 1.5px solid currentColor;
  --lt-social-highlight-padding: 4px;

  /* Form */
  --lt-input-bg: transparent;
  --lt-input-radius: 30px;
  --lt-input-border: 1px solid rgba(0, 0, 0, 0.15);
  --lt-input-padding: 14px 24px;
  --lt-input-color: #1c1c1c;
  --lt-input-placeholder-color: #9e9e9e;
  --lt-submit-color: #000000;
  --lt-submit-weight: 700;

  /* Profile pic */
  --lt-profile-size: 84px;
  --lt-profile-border: 5px solid #ffffff;
  --lt-profile-overlap: -42px;

  /* Cover */
  --lt-cover-radius: 20px;
  --lt-cover-margin: 12px;
  --lt-cover-aspect: 16 / 10;

  /* Contact-section profile pic */
  --lt-contact-profile-size: 140px;
  --lt-contact-profile-radius: 32px;

  /* Brands grid */
  --lt-brands-columns: 3;
  --lt-brands-gap: 16px;
  --lt-brands-logo-max-height: 48px;

  /* Brands marquee (rolling banner of logos) */
  --lt-marquee-bg: #ffffff;
  --lt-marquee-radius: 12px;
  --lt-marquee-padding: 14px 0;
  --lt-marquee-gap: 48px;
  --lt-marquee-logo-height: 44px;
  --lt-marquee-duration: 30s;

  /* Portfolio thumbs */
  --lt-portfolio-radius: 24px;
  --lt-portfolio-gap: 16px;

  /* Accent */
  --lt-accent: #d4a847;

  /* Apply base styles */
  background: var(--lt-page-bg);
  background-attachment: fixed;
  min-height: 100vh;
  font-family: var(--lt-font-body);
  color: var(--lt-name-color);
}

/* ============================================================
   PRESET: warm (Joseph Peguero default — Beacons-style)
   ============================================================ */
.linktree-page[data-preset="warm"] {
  /* Dark gradient page background — the card sits on top as a white
     surface with margin on the sides showing this background. */
  --lt-page-bg: linear-gradient(
    135deg,
    #0e0e0e 0%,
    #2a2a2a 50%,
    #1a1a1a 100%
  );
  --lt-card-bg: #ffffff;
  --lt-card-max-width: 720px;
  --lt-card-radius: 24px;
  --lt-card-padding: 20px;
  /* Profile pic sits without a ring against the white card. */
  --lt-profile-border: none;
  /* Cover keeps its natural aspect ratio so the photo isn't cropped. */
  --lt-cover-aspect: auto;
  --lt-accent: #d4a847;
}

/* ============================================================
   PRESET: minimal (corporate, clean)
   ============================================================ */
.linktree-page[data-preset="minimal"] {
  --lt-page-bg: #f5f5f5;
  --lt-card-bg: #ffffff;
  --lt-btn-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  --lt-accent: #0066cc;
}

/* ============================================================
   PRESET: dark
   ============================================================ */
.linktree-page[data-preset="dark"] {
  --lt-page-bg: linear-gradient(180deg, #0a0a0a 0%, #1a1a2e 100%);
  --lt-card-bg: rgba(255, 255, 255, 0.04);
  --lt-btn-bg: rgba(255, 255, 255, 0.08);
  --lt-btn-shadow: none;
  --lt-btn-border: 1px solid rgba(255, 255, 255, 0.15);
  --lt-btn-icon-bg: #ffffff;
  --lt-btn-icon-color: #000000;
  --lt-btn-title-color: #ffffff;
  --lt-btn-subtitle-color: rgba(255, 255, 255, 0.6);
  --lt-name-color: #ffffff;
  --lt-bio-color: rgba(255, 255, 255, 0.7);
  --lt-social-color: #ffffff;
  --lt-input-border: 1px solid rgba(255, 255, 255, 0.2);
  --lt-input-color: #ffffff;
  --lt-input-placeholder-color: rgba(255, 255, 255, 0.4);
  --lt-submit-color: #ffffff;
  --lt-profile-border: 4px solid #1a1a2e;
}

/* ============================================================
   STRUCTURE — card container
   ============================================================ */
.linktree-page .lt-card {
  /* Mobile: full viewport minus side margins. Desktop: capped by
     `--lt-card-max-width` so the card sits centered with gutters
     showing the page background on the sides. */
  width: min(100% - 32px, var(--lt-card-max-width));
  margin: 24px auto;
  padding: var(--lt-card-padding);
  background: var(--lt-card-bg);
  border-radius: var(--lt-card-radius);
  display: flex;
  flex-direction: column;
  gap: var(--lt-card-gap);
}

/* Neutralize Divi 4 section/row/column wrappers that the page builder
   injects around the modules. We keep them in the DOM (so the Visual
   Builder still sees a valid section/row/column tree) but make them
   transparent to the .lt-card flex layout. */
.linktree-page .lt-card .et_pb_section,
.linktree-page .lt-card .et_pb_row,
.linktree-page .lt-card .et_pb_column {
  display: contents;
  background: none !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  width: auto !important;
}

/* ============================================================
   PROFILE MODULE — cover, profile pic, name, bio, socials
   ============================================================ */
.linktree-page .lt-profile { position: relative; }

.linktree-page .lt-cover-wrap {
  position: relative;
  margin: var(--lt-cover-margin);
}

.linktree-page .lt-cover-img {
  width: 100%;
  /* When --lt-cover-aspect is `auto`, the image keeps its natural
     proportions (height computes from intrinsic ratio + 100% width)
     and object-fit becomes a no-op. When the token is a ratio
     (e.g. 16/10), the image is cropped to fit. */
  aspect-ratio: var(--lt-cover-aspect);
  height: auto;
  object-fit: cover;
  border-radius: var(--lt-cover-radius);
  display: block;
}

.linktree-page .lt-cover-credit {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  font-size: 10px;
  letter-spacing: 0.1em;
  border-radius: 12px;
  text-transform: uppercase;
}

.linktree-page .lt-cover-action {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  color: #1c1c1c;
  text-decoration: none;
}

.linktree-page .lt-profile-pic {
  width: var(--lt-profile-size);
  height: var(--lt-profile-size);
  border-radius: 50%;
  border: var(--lt-profile-border);
  object-fit: cover;
  display: block;
  margin: var(--lt-profile-overlap) auto 0;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.linktree-page .lt-name {
  text-align: center;
  font-family: var(--lt-font-display);
  font-size: var(--lt-name-size);
  font-weight: var(--lt-name-weight);
  color: var(--lt-name-color);
  margin: 12px 0 4px;
}

.linktree-page .lt-bio {
  text-align: center;
  font-family: var(--lt-font-display);
  font-size: var(--lt-bio-size);
  font-weight: var(--lt-bio-weight);
  color: var(--lt-bio-color);
  margin: 0 0 12px;
}

/* Social row */
.linktree-page .lt-socials {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--lt-social-gap);
  margin: 8px 0 16px;
}

.linktree-page .lt-socials a {
  color: var(--lt-social-color);
  font-size: var(--lt-social-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: calc(var(--lt-social-size) + 12px);
  height: calc(var(--lt-social-size) + 12px);
}

.linktree-page .lt-socials a.lt-social-highlight {
  border: var(--lt-social-highlight-border);
  border-radius: 50%;
  padding: var(--lt-social-highlight-padding);
}

.linktree-page .lt-socials svg {
  width: 1em;
  height: 1em;
  /* Icons are outline-style: no fill, stroke follows --lt-social-color. */
  fill: none;
  stroke: currentColor;
}

/* ============================================================
   BUTTONS MODULE — pill links with icon-in-circle
   ============================================================ */
.linktree-page .lt-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--lt-btn-gap);
  margin: 8px 0;
}

.linktree-page .lt-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--lt-btn-bg);
  border: var(--lt-btn-border);
  border-radius: var(--lt-btn-radius);
  box-shadow: var(--lt-btn-shadow);
  padding: var(--lt-btn-padding);
  text-decoration: none;
  color: var(--lt-btn-title-color);
  font-family: var(--lt-font-display);
  transition: transform 0.15s ease;
}

.linktree-page .lt-btn:hover {
  transform: translateY(-1px);
}

.linktree-page .lt-btn-icon {
  flex-shrink: 0;
  width: var(--lt-btn-icon-size);
  height: var(--lt-btn-icon-size);
  background: var(--lt-btn-icon-bg);
  color: var(--lt-btn-icon-color);
  border-radius: var(--lt-btn-icon-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--lt-btn-icon-size) * 0.5);
}

.linktree-page .lt-btn-icon img,
.linktree-page .lt-btn-icon svg {
  width: 55%;
  height: 55%;
  object-fit: contain;
  fill: currentColor;
}

.linktree-page .lt-btn-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.linktree-page .lt-btn-title {
  font-size: var(--lt-btn-title-size);
  font-weight: var(--lt-btn-title-weight);
  color: var(--lt-btn-title-color);
  line-height: 1.3;
}

.linktree-page .lt-btn-subtitle {
  font-size: var(--lt-btn-subtitle-size);
  color: var(--lt-btn-subtitle-color);
  line-height: 1.3;
}

/* ============================================================
   FLAT BUTTON STYLE — Linktree.com look (no icon circles)
   ============================================================ */
.linktree-page[data-btn-style="flat"] .lt-btn {
  justify-content: center;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.linktree-page[data-btn-style="flat"] .lt-btn-icon {
  display: none;
}

.linktree-page[data-btn-style="flat"] .lt-btn-text {
  flex: none;
  text-align: center;
  align-items: center;
}

.linktree-page[data-btn-style="flat"] .lt-btn-title {
  font-weight: 600;
  font-size: 16px;
}

/* Header-type buttons (non-clickable labels like RNC) */
.linktree-page .lt-btn-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  font-family: var(--lt-font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--lt-btn-title-color);
  background: transparent;
  border: none;
  text-align: center;
}

/* Filled social icons (Linktree.com style) */
.linktree-page[data-social-style="filled"] .lt-social-row svg {
  fill: currentColor;
  stroke: none;
}

/* ============================================================
   BRANDS GRID — overrides Divi gallery when scoped
   ============================================================ */
.linktree-page .lt-brands-heading {
  text-align: center;
  font-family: var(--lt-font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--lt-name-color);
  margin: 24px 0 4px;
}

.linktree-page .lt-brands-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--lt-bio-color);
  margin: 0 0 16px;
}

.linktree-page .lt-brands {
  display: grid;
  grid-template-columns: repeat(var(--lt-brands-columns), 1fr);
  gap: var(--lt-brands-gap);
  align-items: center;
  justify-items: center;
  margin: 16px 0 24px;
}

.linktree-page .lt-brands img {
  max-height: var(--lt-brands-logo-max-height);
  max-width: 100%;
  object-fit: contain;
}

/* When the client uses a single column (e.g. josephpeguero.com), each
   "logo" is usually a pre-composited row that already contains several
   brand marks. The default 48px cap would squash those rows, so allow
   them up to the natural ratio at the card width. */
.linktree-page .lt-brands[style*="--lt-brands-columns: 1"] img,
.linktree-page .lt-brands[style*="--lt-brands-columns:1"] img {
  max-height: none;
  width: 100%;
  height: auto;
}

/* Divi native gallery override when scoped inside linktree-page */
.linktree-page .et_pb_gallery_items {
  display: grid !important;
  grid-template-columns: repeat(var(--lt-brands-columns), 1fr) !important;
  gap: var(--lt-brands-gap) !important;
}

.linktree-page .et_pb_gallery_item {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.linktree-page .et_pb_gallery_image img {
  max-height: var(--lt-brands-logo-max-height);
  object-fit: contain;
}

/* ============================================================
   PORTFOLIO GRID — Divi video thumbs scoped
   ============================================================ */
.linktree-page .lt-portfolio-heading {
  text-align: center;
  font-family: var(--lt-font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--lt-name-color);
  margin: 24px 0 8px;
}

.linktree-page .lt-portfolio-description {
  text-align: center;
  font-size: 14px;
  color: var(--lt-bio-color);
  margin: 0 0 16px;
  padding: 0 12px;
}

.linktree-page .lt-portfolio {
  display: flex;
  flex-direction: column;
  gap: var(--lt-portfolio-gap);
  margin: 16px 0;
}

.linktree-page .lt-portfolio iframe,
.linktree-page .lt-portfolio .lt-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--lt-portfolio-radius);
  overflow: hidden;
  border: none;
}

.linktree-page .et_pb_video,
.linktree-page .et_pb_video_box {
  border-radius: var(--lt-portfolio-radius) !important;
  overflow: hidden;
}

/* ============================================================
   CONTACT FORM — pill inputs, submit as text
   ============================================================ */
.linktree-page .lt-contact {
  margin: 24px 0;
  text-align: center;
}

.linktree-page .lt-contact-profile {
  width: var(--lt-contact-profile-size);
  height: var(--lt-contact-profile-size);
  border-radius: var(--lt-contact-profile-radius);
  object-fit: cover;
  margin: 0 auto 12px;
  display: block;
}

.linktree-page .lt-contact-heading {
  font-family: var(--lt-font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--lt-name-color);
  margin: 4px 0;
}

.linktree-page .lt-contact-subtitle {
  font-size: 14px;
  color: var(--lt-bio-color);
  margin: 0 0 16px;
  padding: 0 12px;
}

.linktree-page .lt-contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.linktree-page .lt-contact-form input,
.linktree-page .lt-contact-form textarea {
  width: 100%;
  background: var(--lt-input-bg);
  border: var(--lt-input-border);
  border-radius: var(--lt-input-radius);
  padding: var(--lt-input-padding);
  font-family: var(--lt-font-display);
  font-size: 14px;
  color: var(--lt-input-color);
  outline: none;
  transition: border-color 0.15s ease;
}

.linktree-page .lt-contact-form input::placeholder,
.linktree-page .lt-contact-form textarea::placeholder {
  color: var(--lt-input-placeholder-color);
  font-family: var(--lt-font-display);
}

.linktree-page .lt-contact-form input:focus,
.linktree-page .lt-contact-form textarea:focus {
  border-color: var(--lt-accent);
}

.linktree-page .lt-contact-submit {
  background: none;
  border: none;
  color: var(--lt-submit-color);
  font-weight: var(--lt-submit-weight);
  font-family: var(--lt-font-display);
  font-size: 15px;
  text-align: center;
  width: 100%;
  padding: 12px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0.02em;
}

.linktree-page .lt-contact-submit:hover {
  text-decoration: underline;
}

/* Divi native contact form override when scoped */
.linktree-page .et_pb_contact .et_pb_contact_field {
  width: 100% !important;
  padding: 0 0 12px !important;
}

.linktree-page .et_pb_contact_field_options_wrapper input,
.linktree-page .et_pb_contact_field_options_wrapper textarea,
.linktree-page .et_pb_contact_field input.input,
.linktree-page .et_pb_contact_field textarea.input {
  border-radius: var(--lt-input-radius) !important;
  padding: var(--lt-input-padding) !important;
  border: var(--lt-input-border) !important;
  background: var(--lt-input-bg) !important;
}

.linktree-page .et_pb_contact_form_container .et_pb_button,
.linktree-page .et_pb_contact_form .et_pb_button {
  background: none !important;
  border: none !important;
  color: var(--lt-submit-color) !important;
  font-weight: var(--lt-submit-weight) !important;
  box-shadow: none !important;
  padding: 12px !important;
}

/* ============================================================
   WEBSITE URL TEXT — small caps centered between brands and contact
   ============================================================ */
.linktree-page .lt-website-url {
  text-align: center;
  font-family: var(--lt-font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--lt-name-color);
  text-transform: uppercase;
  margin: 24px 0;
  text-decoration: none;
  display: block;
}

/* ============================================================
   FOOTER
   ============================================================ */
.linktree-page .lt-footer {
  text-align: center;
  font-size: 12px;
  color: var(--lt-bio-color);
  padding: 16px 0;
}

/* ============================================================
   RESPONSIVE — mobile-first, no override needed up to 480px.
   Above 480px, card stays centered max-width.
   ============================================================ */
@media (min-width: 768px) {
  .linktree-page .lt-card { padding: 24px; }
  .linktree-page .lt-cover-margin { margin: 16px; }
}

/* ============================================================
   BRANDS MARQUEE — single-row rolling banner of logos
   The track holds the logos twice so a translate from 0 to -50%
   creates a seamless infinite loop. Direction is controlled by
   `data-direction="left|right"` on the parent .lt-marquee.
   ============================================================ */
.linktree-page .lt-marquee {
  overflow: hidden;
  background: var(--lt-marquee-bg);
  border-radius: var(--lt-marquee-radius);
  padding: var(--lt-marquee-padding);
  margin: 6px 0;
  position: relative;
}

.linktree-page .lt-marquee-track {
  display: flex;
  align-items: center;
  gap: var(--lt-marquee-gap);
  width: max-content;
  animation: lt-marquee-left var(--lt-marquee-duration) linear infinite;
}

.linktree-page .lt-marquee[data-direction="right"] .lt-marquee-track {
  animation-name: lt-marquee-right;
}

.linktree-page .lt-marquee-track > * {
  flex-shrink: 0;
}

.linktree-page .lt-marquee-track img {
  height: var(--lt-marquee-logo-height);
  width: auto;
  display: block;
  object-fit: contain;
}

.linktree-page .lt-marquee:hover .lt-marquee-track {
  animation-play-state: paused;
}

@keyframes lt-marquee-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes lt-marquee-right {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .linktree-page .lt-marquee-track {
    animation: none;
    transform: none;
  }
}
