/* Anime Addy Site — dark theme styling. Loaded by includes/appearance.php.
   (If you still have CSS in Appearance > Customize > Additional CSS, clear it — it lives here now.)
   Colors live in the variables below, so you can retune the whole look in one place.
   -------------------------------------------------- */

:root {
  --hub-bg: #0b0b10;
  --hub-card: #15151d;
  --hub-card-2: #1d1d27;       /* tracks, dividers */
  --hub-border: #2b2b38;
  --hub-text: #ececf3;
  --hub-muted: #9a9aad;
  --hub-accent: #5fd38d;       /* the old #3a9e5f, brightened for dark backgrounds */
  --hub-gradient: linear-gradient(to right, #f9a8d4, #fde68a, #86efac, #67e8f9, #c4b5fd);
}

/* ----- Page ----- */

/* Only <html> gets the dark color. <body> and the theme wrappers must stay transparent,
   otherwise they paint on top of the confetti canvas (which sits behind the content). */
html {
  background: var(--hub-bg) !important;
}

body,
.wp-site-blocks {
  background: transparent !important;
  color: var(--hub-text);
}

body a { color: var(--hub-accent); }

/* The confetti dots animation is not CSS — it's the canvas script in
   snippets/ambient-background.html (Code Snippets plugin). Its background color
   must match --hub-bg above. */

/* ----- Fading profile pic hero (link.me style) -----
   Add a Cover block at the very top of the page, set its Additional CSS class to
   "hub-hero", pick your profile pic as the image, and set the overlay opacity to 0.
   The photo fades out into the page background instead of ending in a hard edge.
   Add the class "hub-hero--soft" as well for a blurred, softer version.

   Three knobs (change these to taste):
     --hub-hero-height       how tall the hero is (taller = more of the photo shows)
     --hub-hero-fade-start   where the photo starts to fade (higher % = stays solid longer)
     --hub-hero-fade-end     where it's fully gone (100% = right at the bottom edge)
   The fade has a soft middle step so it eases out instead of dropping off. */

:root {
  --hub-hero-height: 540px;
  --hub-hero-fade-start: 62%;
  --hub-hero-fade-end: 100%;
}

.hub-hero {
  min-height: var(--hub-hero-height);
  background: transparent !important;
  position: relative;
  /* keep the content (logo) at the bottom-center of the photo */
  align-items: flex-end !important;
  justify-content: center !important;
}

.hub-hero .wp-block-cover__background { opacity: 0 !important; }

.hub-hero .wp-block-cover__image-background {
  -webkit-mask-image: linear-gradient(to bottom,
    #000 var(--hub-hero-fade-start),
    rgba(0, 0, 0, 0.55) calc((var(--hub-hero-fade-start) + var(--hub-hero-fade-end)) / 2),
    transparent var(--hub-hero-fade-end));
  mask-image: linear-gradient(to bottom,
    #000 var(--hub-hero-fade-start),
    rgba(0, 0, 0, 0.55) calc((var(--hub-hero-fade-start) + var(--hub-hero-fade-end)) / 2),
    transparent var(--hub-hero-fade-end));
  object-fit: cover;
  object-position: center top;
}

.hub-hero--soft .wp-block-cover__image-background {
  filter: blur(14px) brightness(0.85);
  transform: scale(1.08);
}

.hub-hero .wp-block-cover__inner-container {
  position: relative;
  z-index: 2;
  color: var(--hub-text);
  text-align: center;
  padding-bottom: 8px;
}

/* ----- Logo (your sparkly GIF) -----
   Put an Image block inside the Cover, choose the GIF, and give the Image block the
   Additional CSS class "hub-logo". It's centered, capped in size, and gets a soft shadow
   so it stays readable over the photo. Change the 360px to make it bigger or smaller. */

.hub-logo {
  margin: 0 auto;
  text-align: center;
}

.hub-logo img {
  display: block;
  margin: 0 auto;
  width: auto;
  max-width: min(360px, 86%);
  height: auto;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.6));
}

/* ----- Header overlapping the hero photo -----
   Applies automatically on any page whose FIRST block is a "hub-hero" Cover; every other page keeps
   its normal header. The header floats over the top of the photo, the photo runs edge to edge from
   the very top of the page, and a soft dark scrim at the top keeps the logo and icons readable.
   To remove the overlap, delete this whole section. To strengthen/soften the scrim, change the 0.7
   and the 170px below. */

body:has(.entry-content > .hub-hero:first-child) .wp-site-blocks {
  position: relative;      /* so the header positions against the page, not the browser window (admin bar safe) */
  overflow-x: clip;        /* the full-bleed photo is 100vw wide, which can be a few px wider than the page */
}

body:has(.entry-content > .hub-hero:first-child) .wp-site-blocks > header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
}

/* remove the gaps that normally sit between the header and the first block */
body:has(.entry-content > .hub-hero:first-child) .wp-site-blocks > main {
  margin-top: 0 !important;
}

body:has(.entry-content > .hub-hero:first-child) main > .wp-block-group:first-child {
  padding-top: 0 !important;
}

/* full-bleed photo, no matter what the Cover's alignment is set to */
body:has(.entry-content > .hub-hero:first-child) .entry-content > .hub-hero:first-child {
  width: 100vw !important;
  max-width: none !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
}

.hub-hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 170px;
  background: linear-gradient(to bottom, rgba(11, 11, 16, 0.7), rgba(11, 11, 16, 0));
  z-index: 1;
  pointer-events: none;
}

/* ----- Instagram / X buttons (under the main OF button) -----
   Put two Button blocks in a Buttons block under the OF button and give each button
   the Additional CSS class "hub-btn-social". */

.hub-btn-social .wp-block-button__link {
  background: var(--hub-card) !important;
  color: var(--hub-text) !important;
  border: 1px solid var(--hub-border);
  border-radius: 999px;
  font-weight: 600;
  padding: 12px 22px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.hub-btn-social .wp-block-button__link:hover {
  background: var(--hub-card-2) !important;
  border-color: var(--hub-accent);
}

/* ----- Platform buttons with logos -----
   Add ONE of these classes to a Button block (Advanced > Additional CSS class):
     hub-btn-of          main OnlyFans button, in OnlyFans blue   (keep cht-smart-link on it too)
     hub-btn-instagram   hub-btn-x   hub-btn-telegram   hub-btn-snapchat   hub-btn-patreon   hub-btn-youtube
   The non-OnlyFans ones also need "hub-btn-social" for the dark pill look.
   Logos are the SVGs in assets/icons/, drawn as a mask so the logo takes whatever color is set below. */

:is(.hub-btn-of, .hub-btn-instagram, .hub-btn-x, .hub-btn-patreon, .hub-btn-youtube, .hub-btn-telegram, .hub-btn-snapchat) .wp-block-button__link {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;          /* lets the optional caption sit on its own second line */
  align-items: center;
  align-content: center;
  justify-content: center;
  gap: 0.1em 0.6em;         /* row gap (to the caption) / gap between logo and label */
  text-align: center;
}

/* Layout: any Buttons block that contains these buttons becomes one full-width vertical stack.
   OnlyFans is the tallest and boldest; every other platform button is exactly the same size.
   (!important on the flex direction because WordPress sets its own row layout on Buttons blocks.) */
.wp-block-buttons:has(.hub-btn-of, .hub-btn-social) {
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 12px;
  max-width: 100%;
  /* If the Buttons block sits inside a Stack/Row/Group that is itself a flex container (common in
     block themes), it would otherwise shrink to the width of its text and hug the left edge.
     These force it to fill the available width in every case. */
  width: 100% !important;
  align-self: stretch !important;
  box-sizing: border-box;
}

/* !important because the Button block's own "Width" setting (25% / 50% / 75% in the block sidebar)
   is more specific than this rule — without it, a button with Width set stays narrow. */
.wp-block-buttons .hub-btn-of,
.wp-block-buttons .hub-btn-social {
  flex: 0 0 auto;
  width: 100% !important;
  max-width: none !important;
}

.hub-btn-social .wp-block-button__link {
  min-height: 56px;
}

:is(.hub-btn-of, .hub-btn-instagram, .hub-btn-x, .hub-btn-patreon, .hub-btn-youtube, .hub-btn-telegram, .hub-btn-snapchat) .wp-block-button__link::before {
  content: "";
  flex: none;
  width: 1.25em;
  height: 1.25em;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

/* OnlyFans: brand blue with the dark navy of the wordmark for text + logo (readable contrast) */
.hub-btn-of .wp-block-button__link {
  background: #00aff0 !important;
  color: #04202e !important;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.3rem;
  min-height: 72px;
  padding: 18px 34px;
  box-shadow: 0 6px 24px rgba(0, 175, 240, 0.35);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.hub-btn-of .wp-block-button__link:hover {
  background: #1fc0ff !important;
  box-shadow: 0 8px 30px rgba(0, 175, 240, 0.5);
  transform: translateY(-1px);
}

.hub-btn-of .wp-block-button__link::before {
  -webkit-mask-image: url("../icons/onlyfans.svg");
  mask-image: url("../icons/onlyfans.svg");
  width: 1.5em;
  height: 1.5em;
}

/* Caption under the OnlyFans label — only shown inside Instagram/TikTok/etc. (html.cht-inapp), where
   tapping the button copies the link instead of opening it. Edit the text in `content` below.
   Preview it on a normal browser by adding ?cht_inapp=1 to the page URL. */
html.cht-inapp .hub-btn-of.cht-smart-link .wp-block-button__link::after {
  content: "(copy link and paste in browser)";
  flex: 0 0 100%;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  opacity: 0.8;
}

/* The other platforms keep the dark pill; the logo carries the brand color */
.hub-btn-instagram .wp-block-button__link::before {
  -webkit-mask-image: url("../icons/instagram.svg");
  mask-image: url("../icons/instagram.svg");
  background: linear-gradient(45deg, #feda75, #fa7e1e 30%, #d62976 60%, #962fbf 80%, #4f5bd5);
}

.hub-btn-x .wp-block-button__link::before {
  -webkit-mask-image: url("../icons/x.svg");
  mask-image: url("../icons/x.svg");
  background: #ffffff;
}

.hub-btn-patreon .wp-block-button__link::before {
  -webkit-mask-image: url("../icons/patreon.svg");
  mask-image: url("../icons/patreon.svg");
  background: #ff424d;
}

.hub-btn-youtube .wp-block-button__link::before {
  -webkit-mask-image: url("../icons/youtube.svg");
  mask-image: url("../icons/youtube.svg");
  background: #ff0033;
}

.hub-btn-telegram .wp-block-button__link::before {
  -webkit-mask-image: url("../icons/telegram.svg");
  mask-image: url("../icons/telegram.svg");
  background: #26a5e4;
}

.hub-btn-snapchat .wp-block-button__link::before {
  -webkit-mask-image: url("../icons/snapchat.svg");
  mask-image: url("../icons/snapchat.svg");
  background: #fffc00;
}

/* ----- Homepage title -----
   The homepage's page title (Pages > Home) is hidden on screen but stays in the page for search engines,
   link previews and screen readers. Only the homepage is affected; other pages keep their titles. */

body.home .wp-block-post-title {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ----- Stray mini-cart drawer -----
   WooCommerce still prints the (empty) slide-out cart at the bottom of every page, even with the header's
   Mini Cart button removed, and without the button's styles it shows up as plain "Your cart (items: 0)" text.
   Hidden only when the page has no Mini Cart button, so it comes back on its own if you ever add one. */

body:not(:has(.wc-block-mini-cart)) > .wc-block-components-drawer__screen-overlay {
  display: none !important;
}

/* ----- No footer -----
   Hides the theme's footer on every page (the logo GIF, spacers, and the "Twenty Twenty-Five / Designed
   with WordPress" credit) and leaves a little room under the last block. To bring the footer back,
   delete this section. (Or remove it for good in Appearance > Editor > Patterns > Template parts > Footer.) */

.wp-site-blocks > footer {
  display: none !important;
}

.wp-site-blocks > main {
  padding-bottom: max(48px, env(safe-area-inset-bottom));  /* safe-area keeps it clear of the iPhone home bar */
}

/* ----- Mail Club Cancel Form ----- */

.mcs-cancel-form {
  background: var(--hub-card);
  border: 1px solid var(--hub-border);
  border-radius: 14px;
  padding: 24px 20px;
}

.mcs-cancel-message {
  font-size: 14px;
  color: #bfe8cd;
  background: #10261a;
  border: 1px solid #1f4a30;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 16px;
}

.mcs-cancel-form label {
  display: block;
  font-size: 13px;
  color: var(--hub-muted);
  margin-bottom: 6px;
}

.mcs-cancel-form input[type="email"] {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 15px;
  background: var(--hub-bg);
  color: var(--hub-text);
  border: 1px solid var(--hub-border);
  border-radius: 10px;
  outline: none;
  margin-bottom: 12px;
  font-family: inherit;
}

.mcs-cancel-form input[type="email"]:focus {
  border-color: var(--hub-accent);
}

.mcs-cancel-form button[type="submit"] {
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  background: var(--hub-card-2);
  border: 1px solid var(--hub-border);
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  color: var(--hub-text);
}

.mcs-cancel-form button[type="submit"]:hover {
  background: #262633;
}

/* ----- Snail Mail Club ----- */

.snail-mail-club {
  background: var(--hub-card);
  border: 1px solid var(--hub-border);
  border-radius: 14px;
  padding: 20px;
  color: var(--hub-text);
}

/* Remove any gray background from inner columns */
.snail-mail-club .wp-block-column {
  background: transparent !important;
}

/* Round the cat photo corners */
.snail-mail-club .wp-block-image img {
  border-radius: 10px;
}

/* ----- Main bar ----- */

.cht-progress {
  background: var(--hub-card);
  border: 1px solid var(--hub-border);
  border-radius: 14px;
  padding: 16px 20px;
}

/* Square off the bottom corners when the detail panel is present */
.cht-progress:has(+ .cht-progress__detail) {
  border-radius: 14px 14px 0 0;
  border-bottom: none;
}

.cht-progress__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.cht-progress__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--hub-accent);
  letter-spacing: 0.5px;
}

.cht-progress__amounts {
  font-size: 12px;
  color: var(--hub-muted);
}

.cht-progress__track {
  background: var(--hub-card-2);
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
  margin-bottom: 8px;
}

.cht-progress__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--hub-gradient);
  min-width: 14px;
}

.cht-progress__pct {
  font-size: 12px;
  color: var(--hub-muted);
  text-align: right;
}

/* ----- Detail panel (sub-goals) ----- */

.cht-progress__detail {
  background: var(--hub-card);
  border: 1px solid var(--hub-border);
  border-top: none;
  border-radius: 0 0 14px 14px;
  padding: 4px 20px 16px;
  margin-top: -1px;
}

.cht-progress__goal {
  padding: 12px 0;
  border-bottom: 1px solid var(--hub-card-2);
}

.cht-progress__goal:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cht-progress__goal-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.cht-progress__goal-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--hub-accent);
}

.cht-progress__goal-amounts {
  font-size: 12px;
  color: var(--hub-muted);
}

.cht-progress__goal-track {
  background: var(--hub-card-2);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 6px;
}

.cht-progress__goal-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--hub-gradient);
  min-width: 10px;
}

.cht-progress__goal-description {
  font-size: 12px;
  color: var(--hub-muted);
  margin: 4px 0 0;
}

/* Completed goal gets a green checkmark */
.cht-progress__goal.is-complete .cht-progress__goal-title::after {
  content: " ✓";
  color: var(--hub-accent);
}

/* "Copied!" toast (created by assets/js/copy-link.js) — white so it stands out on the dark page */
.cht-copy-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 99999;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  background: #ffffff;
  color: #0b0b10;
  border: none;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
}

/* MailPoet form — fixed: the original had "!important" after the semicolon,
   which browsers ignore. It has to sit inside the declaration. */
#mailpoet_form_1 .mailpoet_message {
  border: none !important;
}
