/*
Theme Name: Stardew Valley BETA
Description: A Stardew Valley inspired single-page WordPress theme with tabbed navigation.
Author: Franceska
Version: 0.9.5
*/

/* ======================================================
   VARIABLES
====================================================== */

:root {
  --container_color: #ffc878;
  --container_color2: #f8ba70;
  --container_color3: #eba867;

  --text_color: #331f28;
  --text_shadow: #ce9c5f;

  --gradient-bg: linear-gradient(
    180deg,
    var(--container_color) 0%,
    var(--container_color2) 50%,
    var(--container_color3) 100%
  );

  --link: rgb(66, 120, 206);
  --link-hover: rgb(26, 185, 56);
}

/* ======================================================
   FONTS
====================================================== */

@font-face {
  font-family: 'SVBoldHu';
  src: url('assets/SVBoldHu.woff2') format('woff2');
}

@font-face {
  font-family: 'Stardew Valley All Caps';
  src: url('assets/StardewValley-AllCaps.woff2') format('woff2');
}

@font-face {
  font-family: 'Stardew Valley';
  src: url('assets/StardewValley.woff2') format('woff2');
}

/* ======================================================
   RESET
====================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  cursor: url("assets/cursor.webp"), auto;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ======================================================
   BODY / BACKGROUND
====================================================== */

body {
  background: url("assets/bg.webp") no-repeat center center fixed;
  background-size: cover;

  font-family: 'Stardew Valley';
  font-size: 32px;
  color: var(--text_color);

  display: flex;
  justify-content: center;
  align-items: flex-start;

  padding-top: 6vh;
}

/* ======================================================
   SEAMLESS CLOUDS (DESKTOP)
====================================================== */

.marquee {
  position: fixed;
  top: 35vh;
  left: 0;
  width: 200%;
  display: flex;
  opacity: 0.8;
  pointer-events: none;
  z-index: -10;
  animation: marquee 150s linear infinite;
}

.marquee .clouds {
  width: 50%;
  flex-shrink: 0;
}

.marquee img {
  width: 100%;
  image-rendering: pixelated;
}

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

/* ======================================================
   LAYOUT WRAPPER
====================================================== */

.menu {
  width: 100%;
  max-width: 1200px;
  position: relative;
}

/* ======================================================
   DESKTOP TABS
====================================================== */

.menu__tabs__container {
  display: flex;
  align-items: flex-end;
  padding-left: 32px;
  position: relative;
  z-index: 50;
}

.menu__tab {
  width: 88px;
  height: 84px;

  display: flex;
  justify-content: center;
  align-items: center;

  background: var(--container_color);

  border-image-source: url("assets/tab_border.png");
  border-style: solid;
  border-width: 20px;
  border-image-slice: 24 22;
  border-image-repeat: round;
  border-radius: 20px;

  position: relative;
}

.menu__tab--active {
  height: 72px;
}

.menu__tab img {
  height: 48px;
  image-rendering: pixelated;
}

/* ======================================================
   MAIN CONTENT PANEL
====================================================== */

.main {
  background: var(--gradient-bg);
  padding: 1em;

  border-image-source: url("assets/border.png");
  border-style: solid;
  border-width: 20px;
  border-image-slice: 24 22;
  border-image-repeat: round;
  border-radius: 20px;
}

/* ======================================================
   CONTENT TRANSITIONS
====================================================== */

.content {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 300ms ease, transform 300ms ease;
}

.content.is-active {
  opacity: 1;
  transform: translateY(0);
}

/* ======================================================
   FLOATING STARDEW TOOLTIP (DESKTOP)
====================================================== */

#sv-tooltip {
  position: fixed;
  pointer-events: none;
  opacity: 0;

  padding: 10px 14px;
  max-width: 280px;

  font-family: 'Stardew Valley';
  font-size: 32px;
  line-height: 1.1;

  background: var(--container_color);
  color: var(--text_color);
  text-shadow: var(--text_shadow) -2px 1px;

  border-image-source: url("assets/tooltip_border.png");
  border-style: solid;
  border-width: 20px;
  border-image-slice: 24 22;
  border-image-repeat: round;
  border-radius: 20px;

  image-rendering: pixelated;
  z-index: 9999;

  transition: opacity 80ms linear;
  box-shadow:
    0 6px 0 rgba(120, 72, 28, 0.85),
    0 10px 18px rgba(0, 0, 0, 0.35);
}

/* ======================================================
   MOBILE  BASE OVERRIDES
====================================================== */

@media (max-width: 900px) {

  html,
  body {
    overflow: auto;
  }

  body {
    padding: 0;
  }

  /* Disable clouds on mobile */
  .marquee {
    display: none !important;
  }

  /* Hide desktop tabs */
  .menu__tabs__container {
    display: none !important;
  }

  /* Reserve space for bottom tabs */
  .menu {
    padding-bottom: 84px;
    position: relative;
  }
}

/* ======================================================
   MOBILE  TOOLTIP DISABLED
====================================================== */

@media (max-width: 900px) {
  #sv-tooltip {
    display: none;
  }
}
/* ======================================================
   MOBILE CONTENT  SMOOTH & STABLE
====================================================== */

@media (max-width: 900px) {

  .content {
    display: block;
    font-size: 28px;
    opacity: 0;
    transform: translateY(6px);
    transition:
      opacity 260ms cubic-bezier(0.22, 0.61, 0.36, 1),
      transform 260ms cubic-bezier(0.22, 0.61, 0.36, 1);
    transition-duration: 300ms;
    will-change: opacity, transform;
  }

  .content.is-active {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ======================================================
   MOBILE MENU  SAFE FIX (NO DESKTOP IMPACT)
====================================================== */

/* Hide mobile UI by default (desktop) */
.sv-hamburger,
.sv-mobile-menu {
  display: none;
}

/* Mobile only */
@media (max-width: 900px) {

  /* Hide desktop tabs */
  .menu__tabs__container {
    display: none !important;
  }

  /* Keep layout stable */
  body {
    overflow: auto;
    padding-top: 0;
  }

  .menu {
    position: relative;
    padding-top: 96px; /* space for hamburger */
  }

  /* Hamburger (styled like a tab) */
   .sv-hamburger {
    position: absolute;
    top: 15px; /* EXACT tab height minus border overlap */
    right: 24px;

    width: 88px;
    height: 84px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--container_color);
    color: var(--text_color);

    border-image-source: url("assets/tab_border.png");
    border-style: solid;
    border-width: 20px;
    border-image-slice: 24 22;
    border-image-repeat: round;
    border-radius: 20px;

    font-family: 'Stardew Valley';
    font-size: 36px;
    line-height: 1;

    cursor: url("assets/cursor.webp"), auto;
    z-index: 60;
  }

  .sv-hamburger:active,
  .sv-hamburger.is-open {
    transform: translateY(0.5px);
    filter: brightness(0.95);
  }

  /* Dropdown panel */
  .sv-mobile-menu {
    position: absolute;
    top: 98px;
    right: 24px;

    width: 220px;
    background: var(--container_color);

    border: 4px solid #b86f32;
    border-radius: 12px;

    box-shadow:
      0 4px 0 rgba(120, 72, 28, 0.85), /* pixel-style lip */
      0 8px 14px rgba(0, 0, 0, 0.25);

    display: none;
    flex-direction: column;
    z-index: 99;
    overflow: hidden;
  }

  .sv-mobile-menu.is-open {
    display: flex;
  }

  /* Menu items */
  .sv-mobile-menu .menu__tab {
    all: unset;
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px 14px;
    font-family: 'Stardew Valley';
    font-size: 22px;
    color: var(--text_color);
    cursor: url("assets/cursor.webp"), auto;

  }
   
  .sv-mobile-menu .menu__tab * {
    cursor: url("assets/cursor.webp"), auto;
  }

  .sv-mobile-menu .menu__tab img {
    height: 28px;
    image-rendering: pixelated;
  }

  /* Divider lines */
  .sv-mobile-menu .menu__tab + .menu__tab {
    border-top: 2px solid #d29b5f;
  }

  .sv-mobile-menu .menu__tab:hover {
    background: var(--container_color2);
  }
}

.sv-hamburger .burger {
  position: relative;
  width: 28px;
  height: 4px;
  background: var(--text_color);
  border-radius: 2px;
  transition: transform 160ms ease, background 160ms ease;
}

/* Top & bottom lines */
.sv-hamburger .burger::before,
.sv-hamburger .burger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 28px;
  height: 4px;
  background: var(--text_color);
  border-radius: 2px;
  transition: transform 160ms ease, top 160ms ease, opacity 160ms ease;
}

.sv-hamburger .burger::before {
  top: -9px;
}

.sv-hamburger .burger::after {
  top: 9px;
}
.sv-hamburger:active {
  transform: translateY(4px);
}


/* ===============================
   HAMBURGER OPEN STATE
================================ */

.sv-hamburger.is-open .burger {
  background: transparent;
}

.sv-hamburger.is-open .burger::before {
  top: 0;
  transform: rotate(45deg);
}

.sv-hamburger.is-open .burger::after {
  top: 0;
  transform: rotate(-45deg);
}


/* ===============================
   MOBILE DROPDOWN FIX
================================ */
@media (max-width: 900px) {
  .sv-hamburger {
    display: flex !important;
  }

  .sv-mobile-menu {
    display: none;
  }

  .sv-mobile-menu.is-open {
    display: flex;
  }
}

/* ======================================================
   FLOATING TOOLTIP  MOUSE FOLLOW (DESKTOP)
====================================================== */

#sv-tooltip {
  position: fixed;
  pointer-events: none;
  opacity: 0;

  padding: 10px 14px;
  max-width: 280px;

  font-family: 'Stardew Valley';
  font-size: 32px;
  line-height: 1.1;
  text-align: center;

  background: var(--container_color);
  color: var(--text_color);
  text-shadow: var(--text_shadow) -2px 1px;

  border-image: url("assets/tooltip_border.png") 24 22 round;
  border-width: 20px;
  border-style: solid;
  border-radius: 20px;

  box-shadow:
    0 6px 0 rgba(120, 72, 28, 0.85),
    0 10px 18px rgba(0, 0, 0, 0.35);

  z-index: 9999;
  transition: opacity 80ms linear;
}

/* Disable old pseudo-tooltips */
.menu__tab[data-tooltip]::before {
  display: none !important;
}

/* Mobile: no tooltip */
@media (max-width: 900px) {
  #sv-tooltip {
    display: none !important;
  }
}

/* =========================================
   Stardew Dialogue Portrait System
========================================= */

.sv-dialogue {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

/* Portrait */
.sv-portrait {
  width: 160px;
  flex-shrink: 0;
}

.sv-portrait img {
  width: 100%;
  image-rendering: pixelated;
}

/* Text expands properly */
.sv-dialogue-text {
  flex: 1;
  min-width: 0;
}

/* Hide on mobile */
@media (max-width: 900px) {
  .sv-portrait {
    display: none;
  }

  .sv-dialogue {
    display: block;
  }
}


/* ==========================================
   STARDEW PORTRAIT BOX 
========================================== */

@media (min-width: 901px) {

  .sv-dialogue-layout {
    display: flex;
    align-items: flex-start;
    gap: 18px;
  }

  /* Portrait panel */
  .sv-portrait-frame {
    width: 260px;

    background: var(--gradient-bg);

    border-image-source: url("assets/border.png");
    border-style: solid;
    border-width: 20px;
    border-image-slice: 24 22;
    border-image-repeat: round;
    border-radius: 20px;

    padding: 12px;
  }

  .sv-portrait-frame img {
    width: 100%;
    height: auto;
    display: block;
    image-rendering: pixelated;
  }
}

/* Mobile hides portrait */
@media (max-width: 900px) {
  .sv-portrait-area { }
}


/* Portrait desktop only */
.sv-dialogue-layout{display:flex;gap:1px;align-items:flex-start;}
.sv-portrait-area{flex:0 0 auto; margin-left: -260px;}
.sv-portrait-frame{
  background:var(--gradient-bg);
  border-image:url("assets/border.png") 24 22 round;
  border-width:20px;
  border-style:solid;
  border-radius:20px;
  padding:8px;
}
@media (max-width:900px){
  .sv-portrait-area{display:none!important;}
}

/* ======================================
   STARDEW BULLET — THROBBING
====================================== */

.main ul li::marker {
  content: "";
}

.main ul li {
  list-style: none;
  position: relative;
  padding-left: 34px;
}

.main ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;

  width: 18px;
  height: 18px;

  background: url("assets/bulletin.svg") no-repeat center/contain;

  animation: stardewPulse 2.6s ease-in-out infinite;
  transform-origin: center;
}

/* gentle breathing effect */
@keyframes stardewPulse {
  0%   { transform: scale(1);      filter: brightness(1); }
  50%  { transform: scale(1.14);   filter: brightness(1.25); }
  100% { transform: scale(1);      filter: brightness(1); }
}

/* =========================================
   MAIN PANEL SCROLL CONTAINER
========================================= */

.main {
  max-height: calc(100vh - 220px); /* fits under tabs */
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px; /* space for scrollbar */
}

/* =========================================
   STARDEW VALLEY SCROLLBAR — THICKER
========================================= */

.main::-webkit-scrollbar {
  width: 96px; /* was 18px */
}

.main::-webkit-scrollbar-track {
  background: #e9b36c;
  border-left: 20px solid #b97a3c;
  border-right: 20px solid #b97a3c;
}

.main::-webkit-scrollbar-thumb {
  background: #c98a45;
  border: 20x solid #7b4a1f;
  border-radius: 20px;
}

.main::-webkit-scrollbar-thumb:hover {
  background: #d79a56;
}

/* Firefox */
.main {
  scrollbar-width: auto; /* thicker than 'thin' */
  scrollbar-color: #c98a45 #e9b36c;
}

@media (max-width: 900px) {
  .main {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

/* =========================================
   OVERRIDE WORDPRESS ACCORDION CURSOR
========================================= */

.wp-block-accordion-heading__toggle { 
cursor: url("assets/cursor.webp"), auto;
}
