/*
Theme Name: YMAS - לשכת יועצי המס
Theme URI: https://www.taxadvisors.org.il
Description: Custom theme for לשכת יועצי המס בישראל (Israel Tax Advisors Association)
Version: 1.1.3
Author: Lidor Hadar
Text Domain: ymas
Text Direction: rtl
*/

/* =========================================
   CSS Variables / Design Tokens
   ========================================= */
:root {
  /* Figma Tax 3.3 brand palette */
  --color-primary: #133336;
  --color-primary-dark: #133336;
  --color-primary-light: #629498;
  --color-accent: #d7ba6f;
  --color-accent-light: #e3d2ad;
  --color-bg: #ffffff;
  --color-bg-light: #fafaf8;
  --color-white: #ffffff;
  --color-text: #133336;
  --color-text-muted: #5d5f5f;
  --color-border: #c1c8c8;
  --color-black: #133336;
  --color-gold: #d7ba6f;
  --color-primary-blue: #0048ff;
  --color-grey-light: #ededed;
  --color-grey-mid: #bababa;

  /* Primary action buttons (green gradient) */
  --btn-bg: linear-gradient(135deg, #629498 0%, #133336 100%);
  --btn-bg-hover: linear-gradient(135deg, #5a8b8f 0%, #0c2426 100%);
  --btn-color: #ffffff;
  --color-button: var(--btn-bg);
  --color-button-hover: var(--btn-bg-hover);
  --btn-disabled-bg: var(--color-grey-light);
  --btn-disabled-color: var(--color-grey-mid);
  /* Figma Button-Large/Desktop — Heebo Medium 18 */
  --btn-fs-lg: 18px;
  --btn-fs-sm: 14px;
  --btn-lh: 1.1;
  --btn-fw: 500;

  --font-primary: "Heebo", "Segoe UI", Arial, sans-serif;
  --font-size-base: 16px;

  /* Typography scale — font sizes (Figma text styles) */
  --fs-h1: 38px;
  --fs-h2: 36px;
  --fs-h3: 30px;
  --fs-h4: 24px;
  --fs-h5: 22px;
  --fs-body-xl: 22px;
  --fs-body-l: 18px;
  --fs-body-m: 16px;
  --fs-body-s: 14px;
  --fs-body-xs: 12px;
  --fs-h2-5: var(--fs-h3);
  --fs-lead: var(--fs-body-xl);
  --fs-body-para: var(--fs-body-l);
  --fs-body: var(--fs-body-m);
  --fs-label: var(--fs-body-s);

  /* Typography scale — line heights (110% for headlines) */
  --lh-h1: 1.1;
  --lh-h2: 1.1;
  --lh-h2-5: 1.1;
  --lh-h3: 1.1;
  --lh-h4: 1.1;
  --lh-h5: 1.1;
  --lh-body-scale: 1.3;
  --lh-lead: var(--lh-body-scale);
  --lh-body-para: var(--lh-body-scale);
  --lh-body: var(--lh-body-scale);

  /* Font weights */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-bold: 700;
  --fw-extrabold: 800;

  /* Color gradients (Figma Tax 3.3) */
  --gradient-green: linear-gradient(135deg, #629498 0%, #133336 100%);
  --gradient-green-2: linear-gradient(150deg, #629498 1.4%, #133336 82%);
  --gradient-gold-bg: linear-gradient(135deg, #faf7f0 0%, #e3d2ad 100%);
  --gradient-gold: linear-gradient(135deg, #d7ba6f 0%, #c9a659 100%);
  --gradient-gold-light-button: linear-gradient(
    88deg,
    #e3d2ad 5.4%,
    #f2eada 97.4%
  );
  --gradient-gold-medium: linear-gradient(135deg, #d8c090 0%, #d7ba6f 100%);
  --gradient-gold-light: linear-gradient(135deg, #f2eada 0%, #e3d2ad 100%);
  --gradient-gold-image: linear-gradient(#d7ba6f 0%, #d7ba6f 20%, #c9a659 50%);
  /* Figma "golg gradient" — text fill for logged-in greeting */
  --gradient-gold-text: linear-gradient(
    90deg,
    #c9a659 0%,
    #e3d2ad 45%,
    #d7ba6f 100%
  );
  --gradient-hero-panel: linear-gradient(
    180deg,
    rgba(98, 148, 152, 0.8) 0%,
    #133336 100%
  );
  --gradient-hero-text-fade: linear-gradient(
    to top,
    rgba(19, 51, 54, 0.9),
    rgba(19, 51, 54, 0)
  );

  /* Tag palette — 14 subject label colors */
  --tag-1: #0048ff;
  --tag-2: #1c4c4a;
  --tag-3: #d7ba6f;
  --tag-4: #1f7a4e;
  --tag-5: #a02020;
  --tag-6: #5a2fa1;
  --tag-7: #c45c00;
  --tag-8: #c2185b;
  --tag-9: #133336;
  --tag-10: #558b2f;
  --tag-11: #00838f;
  --tag-12: #795548;
  --tag-13: #3949ab;
  --tag-14: #6b6b6b;

  /* Status tag semantic colors */
  --tag-status-pending-bg: #faf0d9;
  --tag-status-pending-text: #a07a2f;
  --tag-status-pending-border: #ead7a3;
  --tag-status-escalated-bg: #ffeaea;
  --tag-status-escalated-text: #a02020;
  --tag-status-escalated-border: #f0c1c1;
  --tag-status-resolved-bg: #e6f1ec;
  --tag-status-resolved-text: #1f7a4e;
  --tag-status-resolved-border: #c7e1d2;
  --tag-status-reopened-bg: #f3e6ff;
  --tag-status-reopened-text: #5a2fa1;
  --tag-status-reopened-border: #d2c1f0;

  /* Event tag colors */
  --tag-event-free-bg: var(--color-gold);
  --tag-event-free-text: var(--color-black);
  --tag-event-members-bg: #437275;
  --tag-event-members-text: var(--color-white);
  --tag-event-discount-bg: #e3d2ad;
  --tag-event-discount-text: var(--color-black);
  --tag-event-default-bg: var(--color-bg);
  --tag-event-default-text: var(--color-text-muted);

  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 21px;
  --radius-leaf: 100px;
  --radius-cta: 34px;
  --radius-card-media: 10px;
  --radius-media-leaf: 55px; /* media thumb: physical TR + BL */
  --radius-full: 50%;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.14);
  --shadow-drop: 3px 3px 21px rgba(50, 50, 50, 0.21);
  --shadow-hover: 8px 8px 30px rgba(50, 50, 50, 0.2);
  --shadow-card: 3px 3px 21px rgba(50, 50, 50, 0.21);
  --shadow-sheet: 0 12px 40px rgba(0, 0, 0, 0.18);

  --container-max: 1320px;
  --container-padding: clamp(16px, 3vw, 40px);
  /* Keep existing nav chrome height until Phase 4 */
  --nav-height: 72px;
}

/* =========================================
   Reset & Base
   ========================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl;
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  color: var(--color-text);
  background: var(--color-bg-light);
  font-size: var(--fs-body-l);
  font-weight: var(--fw-medium);
  line-height: var(--lh-body-scale);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Push footer to bottom without stretching site-main */
.hs-footer {
  margin-top: auto;
}

img {
  max-width: 200%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* =========================================
   Layout Utilities
   ========================================= */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
  padding: 0 var(--container-padding);
}

.section-title {
  font-size: var(--fs-h3);
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-h3);
  letter-spacing: 0;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  border: 1.48px solid transparent;
  font-family: var(--font-primary);
  font-size: var(--btn-fs-lg);
  font-weight: var(--btn-fw);
  line-height: var(--btn-lh);
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s,
    box-shadow 0.2s,
    opacity 0.2s;
  cursor: pointer;
  text-align: center;
}

.btn--lg {
  padding: 12px clamp(20px, 2vw, 39px);
  min-height: 52px;
  font-size: var(--btn-fs-lg);
}

.btn--sm {
  padding: 8px 20px;
  min-height: 36px;
  font-size: var(--btn-fs-sm);
}

/* Nav Join / primary gold CTA — Figma light gold gradient + primary border */
.btn--gold {
  background: var(--gradient-gold-light-button);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--gold:hover {
  box-shadow: var(--shadow-hover);
}

/* Solid gold fill (hero active “קרא עוד”) */
.btn--filled-gold {
  background: var(--gradient-gold-light-button);
  color: var(--color-primary);
  border-color: transparent;
  /* Large radius: top-left + bottom-right */
  border-radius: var(--radius-cta) var(--radius-sm) var(--radius-cta)
    var(--radius-sm);
  box-shadow: var(--shadow-drop);
}

.btn--filled-gold:hover {
  box-shadow: var(--shadow-hover);
}

/* Outline gold (hero inactive CTA on dark media) */
.btn--outline-gold {
  background: transparent;
  color: var(--color-white);
  border: 2px solid var(--color-gold);
  /* Large radius: top-left + bottom-right */
  border-radius: var(--radius-cta) var(--radius-sm) var(--radius-cta)
    var(--radius-sm);
  box-shadow: var(--shadow-drop);
}

.btn--outline-gold:hover {
  box-shadow: var(--shadow-hover);
}

.btn--green {
  background: var(--gradient-green);
  color: var(--color-white);
  border-color: transparent;
}

.btn--green:hover {
  background: var(--btn-bg-hover);
  box-shadow: var(--shadow-hover);
}

.btn--secondary {
  background: var(--color-white);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--secondary:hover {
  box-shadow: var(--shadow-md);
}

.btn--profile {
  background: var(--gradient-gold-light-button);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--profile:hover {
  box-shadow: var(--shadow-md);
}

/* Quick-nav pill arrow */
.btn--pill-arrow {
  width: 89px;
  max-width: 100%;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: var(--radius-pill);
  border: 1.48px solid var(--color-gold);
  background: var(--color-white);
  color: var(--color-primary);
  box-shadow: 8px 8px 15px rgba(50, 50, 50, 0.2);
}

.btn--pill-arrow:hover {
  box-shadow: var(--shadow-hover);
}

.btn:disabled,
.btn.is-disabled,
.btn--gold:disabled,
.btn--filled-gold:disabled,
.btn--outline-gold:disabled,
.btn--green:disabled,
.btn--secondary:disabled,
.btn--profile:disabled,
.btn--pill-arrow:disabled {
  background: var(--btn-disabled-bg);
  color: var(--btn-disabled-color);
  border-color: var(--color-grey-mid);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
  pointer-events: none;
}

/* Fluid type on small screens so large buttons still fit */
@media (max-width: 768px) {
  .btn,
  .btn--lg {
    font-size: clamp(14px, 3.8vw, var(--btn-fs-lg));
    min-height: 44px;
    padding-inline: clamp(16px, 4vw, 28px);
  }

  .btn--pill-arrow {
    width: 72px;
    height: 32px;
    min-height: 32px;
  }
}

/* =========================================
   Typography — design system utilities
   ========================================= */
.text-h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  font-weight: var(--fw-extrabold);
  letter-spacing: 0;
}

.text-h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  font-weight: var(--fw-extrabold);
  letter-spacing: 0;
}

.text-h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: var(--fw-extrabold);
  letter-spacing: 0;
}

.text-h4 {
  font-size: var(--fs-h4);
  line-height: var(--lh-h4);
  font-weight: var(--fw-bold);
  letter-spacing: 0;
}

.text-h5 {
  font-size: var(--fs-h5);
  line-height: var(--lh-h5);
  font-weight: var(--fw-bold);
  letter-spacing: 0;
}

.text-body-xl {
  font-size: var(--fs-body-xl);
  line-height: var(--lh-body-scale);
  font-weight: var(--fw-medium);
  letter-spacing: 0;
}

.text-body-l {
  font-size: var(--fs-body-l);
  line-height: var(--lh-body-scale);
  font-weight: var(--fw-medium);
  letter-spacing: 0;
}

.text-body-m {
  font-size: var(--fs-body-m);
  line-height: var(--lh-body-scale);
  font-weight: var(--fw-medium);
  letter-spacing: 0;
}

.text-body-m-bold {
  font-size: var(--fs-body-m);
  line-height: var(--lh-body-scale);
  font-weight: var(--fw-extrabold);
  letter-spacing: 0;
}

.text-body-s-bold {
  font-size: var(--fs-body-s);
  line-height: var(--lh-body-scale);
  font-weight: var(--fw-bold);
  letter-spacing: 0;
}

.text-body-s {
  font-size: var(--fs-body-s);
  line-height: var(--lh-body-scale);
  font-weight: var(--fw-medium);
  letter-spacing: 0;
}

.text-body-xs {
  font-size: var(--fs-body-xs);
  line-height: var(--lh-body-scale);
  font-weight: var(--fw-bold);
  letter-spacing: 0;
}

/* =========================================
   Tags — unified badge primitive
   ========================================= */
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: start;
  padding: 4px 14px;
  font-family: var(--font-primary);
  font-size: var(--fs-body-s);
  font-weight: var(--fw-bold);
  line-height: var(--btn-lh);
  letter-spacing: 0;
  /* Let long tags wrap inside their pill instead of overflowing the screen.
     `overflow-wrap: anywhere` breaks very long words too (single-word tags). */
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
  /* Hebrew reading order: text flows right-to-left and wraps from the right. */
  direction: rtl;
  text-align: right;
  unicode-bidi: plaintext;
}

.tag--rect {
  border-radius: var(--radius-md);
  padding: 8px 16px;
  min-height: 32px;
  box-shadow: var(--shadow-card);
}

.tag--pill {
  border-radius: 999px;
  border: 1px solid transparent;
}

.tag--outline {
  background: transparent;
}

/* Event tags */
.tag--event-free {
  background: var(--tag-event-free-bg);
  color: var(--tag-event-free-text);
}

.tag--event-members-only {
  background: var(--tag-event-members-bg);
  color: var(--tag-event-members-text);
}

.tag--event-discount {
  background: var(--tag-event-discount-bg);
  color: var(--tag-event-discount-text);
}

.tag--event-default {
  background: var(--tag-event-default-bg);
  color: var(--tag-event-default-text);
}

.tag--event-dark {
  background: rgba(28, 76, 74, 0.1);
  color: var(--color-primary);
  border: 1px solid rgba(28, 76, 74, 0.15);
}

/* Status tags — three public statuses */
.tag--status-new {
  background: var(--tag-status-pending-bg);
  color: var(--tag-status-pending-text);
  border-color: var(--tag-status-pending-border);
}

.tag--status-in_progress,
.tag--status-assigned,
.tag--status-reopened {
  background: var(--tag-status-pending-bg);
  color: var(--tag-status-pending-text);
  border-color: var(--tag-status-pending-border);
}

.tag--status-closed,
.tag--status-answered {
  background: var(--tag-status-resolved-bg);
  color: var(--tag-status-resolved-text);
  border-color: var(--tag-status-resolved-border);
}

.tag--status-escalated {
  background: var(--tag-status-escalated-bg);
  color: var(--tag-status-escalated-text);
  border-color: var(--tag-status-escalated-border);
}

.tag--status-new.tag--outline,
.tag--status-in_progress.tag--outline,
.tag--status-closed.tag--outline,
.tag--status-assigned.tag--outline,
.tag--status-escalated.tag--outline,
.tag--status-answered.tag--outline,
.tag--status-reopened.tag--outline {
  background: transparent;
}

/* Subject tags — solid pill palette */
.tag--subject-1 {
  background: var(--tag-1);
  color: var(--color-white);
}
.tag--subject-2 {
  background: var(--tag-2);
  color: var(--color-white);
}
.tag--subject-3 {
  background: var(--tag-3);
  color: var(--color-black);
}
.tag--subject-4 {
  background: var(--tag-4);
  color: var(--color-white);
}
.tag--subject-5 {
  background: var(--tag-5);
  color: var(--color-white);
}
.tag--subject-6 {
  background: var(--tag-6);
  color: var(--color-white);
}
.tag--subject-7 {
  background: var(--tag-7);
  color: var(--color-white);
}
.tag--subject-8 {
  background: var(--tag-8);
  color: var(--color-white);
}
.tag--subject-9 {
  background: var(--tag-9);
  color: var(--color-white);
}
.tag--subject-10 {
  background: var(--tag-10);
  color: var(--color-white);
}
.tag--subject-11 {
  background: var(--tag-11);
  color: var(--color-white);
}
.tag--subject-12 {
  background: var(--tag-12);
  color: var(--color-white);
}
.tag--subject-13 {
  background: var(--tag-13);
  color: var(--color-white);
}
.tag--subject-14 {
  background: var(--tag-14);
  color: var(--color-white);
}

.tag--subject-more {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

/* =========================================
   Elevation utilities
   ========================================= */
.elevation-card {
  box-shadow: var(--shadow-card);
}

.elevation-sheet {
  box-shadow: var(--shadow-sheet);
}

/* =========================================
   Brand logo
   ========================================= */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo__img {
  display: block;
  height: 48px;
  width: auto;
  max-width: none;
}

.brand-logo--icon-end {
  flex-direction: row-reverse;
}

/* =========================================
   Icons
   ========================================= */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.icon svg {
  display: block;
}

/* =========================================
   Mobile typography overrides
   ========================================= */
@media (max-width: 768px) {
  :root {
    --fs-h1: 32px;
    --fs-h2: 30px;
    --fs-h3: 28px;
    --fs-h4: 22px;
    --fs-h5: 22px;
  }

  .text-h5 {
    font-weight: var(--fw-medium);
  }
}
