/*
Theme Name: Haken Dran
Theme URI: https://www.hakendran.org
Author: Gavin Karlmeier
Author URI: https://www.hakendran.org
Description: A sleek block theme for the "Haken Dran" social media podcast. Full Site Editor support, self-hosted Source Sans 3, zero trackers.
Version: 3.5.5
Requires at least: 6.2
Tested up to: 6.7
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: hakendran
Tags: blog, podcast, full-site-editing, block-styles, custom-colors, custom-logo, wide-blocks, editor-style
*/

/* ============================================================
   RESET ADDITIONS (beyond theme.json)
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none; /* prevent Chrome from faux-bolding when weight isn't cached yet */
}

body {
  overflow-x: hidden;
}

::selection {
  background: var(--wp--preset--color--teal);
  color: var(--wp--preset--color--white);
}

/* ============================================================
   HEADER
   ============================================================ */
.is-position-sticky {
  z-index: 10;
}

/* ============================================================
   HERO
   ============================================================ */
/* When a page has .hd-hero, make the page a flex column
   so the cover fills all remaining space between header + footer.
   This keeps content vertically centered in the *visible* area. */
.wp-site-blocks:has(.hd-hero) {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  min-height: 100vh; /* fallback */
}

.wp-site-blocks:has(.hd-hero) > .hd-hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hd-hero {
  position: relative;
  background: var(--wp--preset--gradient--hd-hero);
  color: var(--wp--preset--color--white);
}

.hd-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('assets/images/pattern-bg.jpg') center/cover no-repeat;
  opacity: 0.12;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
}

.hd-hero > * {
  position: relative;
  z-index: 2;
}

/* ============================================================
   GRADIENT BACKGROUND (per-page toggle)
   Applies the hero gradient + pattern overlay to any page,
   regardless of which template is used.
   ============================================================ */
.hd-gradient-bg .wp-site-blocks {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  min-height: 100vh;
  position: relative;
  background: var(--wp--preset--gradient--hd-hero);
}

.hd-gradient-bg .wp-site-blocks::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url('assets/images/pattern-bg.jpg') center/cover no-repeat;
  opacity: 0.12;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 0;
}

.hd-gradient-bg .wp-site-blocks > * {
  position: relative;
  z-index: 1;
}

.hd-hero-logo img {
  box-shadow: 0 0 60px rgba(10, 148, 147, 0.4);
  animation: hd-float 6s ease-in-out infinite;
}

/* ============================================================
   CARDS (Glass / Solid / Outline)
   ============================================================ */
.hd-card {
  background: linear-gradient(145deg, rgba(13, 59, 94, 0.6), rgba(10, 148, 147, 0.3));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(10, 148, 147, 0.15);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.hd-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--wp--preset--gradient--hd-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 500ms ease;
}

.hd-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 40px rgba(9, 30, 46, 0.2);
  border-color: rgba(10, 148, 147, 0.3);
}

.hd-card:hover::before {
  transform: scaleX(1);
}

/* ============================================================
   LINK CARDS (Linktree-style)
   ============================================================ */
.hd-link-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(10, 148, 147, 0.1);
  border: 1px solid rgba(10, 148, 147, 0.2);
  border-radius: 20px;
  text-decoration: none;
  color: var(--wp--preset--color--white);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.hd-link-card:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: var(--wp--preset--color--teal);
  box-shadow: 0 0 30px rgba(10, 148, 147, 0.3);
  text-decoration: none;
  color: var(--wp--preset--color--white);
}

.hd-link-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  background: rgba(254, 254, 254, 0.06);
}

.hd-link-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.hd-link-card__icon svg {
  width: 30px;
  height: 30px;
  fill: var(--wp--preset--color--bright-teal);
}

/* Emoji in icon box */
.hd-link-card__icon .hd-icon-emoji {
  display: block;
  font-size: inherit;
  line-height: 1;
}

/* Emoji tinting (opt-in via backend toggle):
   Soft desaturation + slight cool shift — keeps emoji recognisable, reduces
   colour clash against the teal theme. Does NOT flatten to silhouette. */
.hd-linkboard--emoji-tint .hd-icon-emoji {
  filter: grayscale(0.35) hue-rotate(15deg) brightness(1.05);
}

.hd-link-card__text {
  flex: 1;
}

.hd-link-card__title {
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0;
}

.hd-link-card__subtitle {
  font-size: 0.85rem;
  color: var(--wp--preset--color--mid-gray);
  margin: 0;
}

.hd-link-card__arrow {
  color: var(--wp--preset--color--mid-gray);
  transition: all 150ms ease;
}

.hd-link-card:hover .hd-link-card__arrow {
  color: var(--wp--preset--color--bright-teal);
  transform: translateX(4px);
}

/* ============================================================
   BLOCK STYLE: Glass Card
   ============================================================ */
.is-style-hd-glass-card {
  background: linear-gradient(145deg, rgba(13, 59, 94, 0.6), rgba(10, 148, 147, 0.3));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(10, 148, 147, 0.15);
  border-radius: 20px;
  padding: 2rem;
}

.is-style-hd-gradient-bg {
  background: var(--wp--preset--gradient--hd-main);
  border-radius: 20px;
  padding: 2rem;
}

.is-style-hd-magenta .wp-block-button__link {
  background: var(--wp--preset--color--magenta) !important;
  color: white !important;
}

.is-style-hd-ghost .wp-block-button__link {
  background: rgba(254, 254, 254, 0.06) !important;
  backdrop-filter: blur(10px);
  color: white !important;
  border: 1px solid rgba(254, 254, 254, 0.12) !important;
}

.is-style-hd-glow img {
  box-shadow: 0 0 30px rgba(10, 148, 147, 0.3);
}

.is-style-hd-gradient hr {
  border: none;
  height: 2px;
  background: var(--wp--preset--gradient--hd-accent);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes hd-ripple {
  to { transform: scale(2.5); opacity: 0; }
}

@keyframes hd-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes hd-fade-in-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hd-scale-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* Animations play on load via CSS — no JS trigger needed.
   fill-mode:both keeps the element at the "from" state (opacity:0)
   during the animation-delay, then holds the "to" state afterwards.
   This eliminates the "invisible flash" caused by opacity:0 + footer JS. */
.hd-animate--fade-up {
  animation: hd-fade-in-up 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.hd-animate--scale {
  animation: hd-scale-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.hd-delay-1 { animation-delay: 100ms !important; }
.hd-delay-2 { animation-delay: 200ms !important; }
.hd-delay-3 { animation-delay: 300ms !important; }
.hd-delay-4 { animation-delay: 400ms !important; }
.hd-delay-5 { animation-delay: 500ms !important; }

/* ============================================================
   CUSTOM SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--wp--preset--color--dark); }
::-webkit-scrollbar-thumb { background: var(--wp--preset--color--ocean); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--wp--preset--color--teal); }

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--wp--preset--color--bright-teal);
  outline-offset: 2px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .hd-card:hover {
    transform: none;
  }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  body { background: white; color: black; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .hd-animate--fade-up,
  .hd-animate--scale { animation: none; }
  .hd-hero-logo img { animation: none; }
  .hd-card:hover { transform: none; }
  html { scroll-behavior: auto; }
}
