/* css/tylers-daily.css */

:root {
  --td-anim-speed: 0.4s;

  --td-bg: #000000;
  --td-text: #ffcc00;
  --td-accent: #ffcc00;

  --td-font-body: "Georgia", serif;
  --td-font-head: "Bebas Neue", sans-serif;
  --td-border: #333333;
  --td-measure: 680px;
}

.mode-raw {
  --td-bg: #000000;
  --td-text: #ffffff;
  --td-accent: #ff10f0;

  --td-font-body: "Roboto Mono", monospace;
  --td-font-head: "Anton", sans-serif;
  --td-border: #333333;
  --td-measure: 900px;
}

.td-dual-wrapper {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background-color: var(--td-bg);
  color: var(--td-text);
  transition:
    background-color var(--td-anim-speed) ease,
    color var(--td-anim-speed) ease;
  overflow-x: hidden;
  padding-bottom: 10vh;
}

.td-toggle-ui {
  position: fixed;
  top: auto;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2rem;
  font-family: "Roboto Mono", monospace;
  font-size: 0.75rem;
  mix-blend-mode: normal;
  color: var(--td-accent);
}

.td-back-btn,
.td-mode-btn {
  background: transparent;
  border: 1px solid var(--td-accent);
  color: var(--td-accent);
  padding: 0.5rem 1rem;
  cursor: pointer;
  text-transform: uppercase;
  font-family: inherit;
  font-size: inherit;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s,
    background-color 0.3s,
    color 0.3s,
    border-color 0.3s;
}

.td-mode-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  pointer-events: none;
}

.td-mode-btn {
  opacity: 1;
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  width: 120px;
}

.td-mode-text {
  display: block;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.mode-rendered .td-mode-text:nth-child(2) {
  display: none;
}
.mode-raw .td-mode-text:nth-child(1) {
  display: none;
}

/* =========================================
   INDEX VIEW (MENU)
   ========================================= */

.td-index-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  color: #ffcc00 !important;
  will-change: opacity, transform;
  transform: translateZ(0);
}

.td-index-header {
  text-align: center;
  margin-bottom: 4rem;
}

.td-index-header h1 {
  font-family: "Anton", sans-serif;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1;
  margin: 0;
  text-transform: uppercase;
  color: #ffcc00;
}

.td-index-header p {
  font-family: "Roboto Mono", monospace;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  opacity: 0.6;
  margin-top: 1rem;
  color: #cccccc;
}

.td-index-list {
  width: 100%;
  display: grid;
  gap: 2rem;
}

.td-index-item {
  border-top: 1px solid #333;
  padding: 2rem 0;
  cursor: pointer;
  display: grid;
  grid-template-columns: 0.5fr 120px 1fr;
  align-items: center;
  gap: 2rem;
  transition:
    background-color 0.3s,
    border-color 0.3s;
}

.td-index-item:last-child {
  border-bottom: 1px solid #333;
}

.td-idx-issue {
  font-family: "Roboto Mono", monospace;
  font-size: 0.8rem;
  color: #cccccc;
}

.td-idx-title {
  font-family: "Anton", sans-serif;
  font-size: clamp(2rem, 4vw, 4rem);
  margin: 0;
  line-height: 0.9;
  text-transform: uppercase;
  color: #ffcc00;
  transition: transform 0.3s ease;
}

.td-idx-thumb-wrapper {
  width: 120px;
  height: 80px;
  overflow: hidden;
  border: 1px solid #333;
  transition: border-color 0.3s ease;
}

.td-idx-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  transition:
    filter 0.3s ease,
    transform 0.5s ease;
}

/* =========================================
   HOVER & ACTIVE STATES (Desktop vs Mobile)
   ========================================= */

@media (hover: hover) {
  .td-index-item:hover {
    background-color: rgba(255, 204, 0, 0.05);
    border-color: #ffcc00;
  }

  .td-index-item:hover .td-idx-title {
    transform: translateX(10px);
  }

  .td-index-item:hover .td-idx-thumb-wrapper {
    border-color: #ffcc00;
  }

  .td-index-item:hover .td-idx-thumb-wrapper img {
    filter: grayscale(0%);
    transform: scale(1.1);
  }

  .td-back-btn:hover,
  .td-mode-btn:hover {
    background-color: var(--td-accent);
    color: var(--td-bg);
  }
}

.td-index-item:active {
  background-color: rgba(255, 204, 0, 0.1);
  transition: background-color 0.1s ease;
}

.td-back-btn:active,
.td-mode-btn:active {
  background-color: rgba(255, 255, 255, 0.8);
  color: #000;
  transition:
    background-color 0.1s ease,
    color 0.1s ease;
}

/* =========================================
   ARTICLE CONTENT TOGGLING (TITLES & BODY)
   ========================================= */

.td-title-editorial,
.td-content-editorial {
  display: block;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.td-title-raw,
.td-content-raw {
  display: none;
  opacity: 0;
}

.mode-raw .td-title-editorial,
.mode-raw .td-content-editorial {
  display: none;
  opacity: 0;
}

.mode-raw .td-title-raw,
.mode-raw .td-content-raw {
  display: block;
  opacity: 1;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================
   ARTICLE LAYOUT
   ========================================= */

.td-article-container {
  max-width: var(--td-measure);
  margin: 0 auto;
  padding: 8rem 2rem;
  transition: max-width var(--td-anim-speed) ease;
}

.td-header {
  text-align: center;
  margin-bottom: 6rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--td-border);
}

.td-meta {
  font-family: var(--td-font-head);
  font-size: 1rem;
  letter-spacing: 0.2em;
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
  color: var(--td-accent);
}

.td-title {
  font-family: var(--td-font-head);
  font-size: clamp(4rem, 12vw, 10rem);
  line-height: 0.85;
  margin: 0;
  text-transform: uppercase;
  color: var(--td-accent);
}

.td-para {
  font-family: var(--td-font-body);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  line-height: 1.6;
  margin-bottom: 3rem;
  color: var(--td-text);
}

.td-figure {
  margin: 4rem 0;
}
.td-img-container {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--td-border);
  transition: border-color var(--td-anim-speed) ease;
}

.td-figure img {
  width: 100%;
  height: auto;
  display: block;
  transition:
    transform 0.5s ease,
    filter 0.5s ease;
}

.mode-rendered .td-figure img {
  filter: grayscale(100%) contrast(1.1);
}

.mode-raw .td-figure img {
  filter: grayscale(0%) contrast(1.3) hue-rotate(-10deg);
  transform: scale(1.02);
}

.td-figure figcaption {
  font-family: "Roboto Mono", monospace;
  font-size: 0.75rem;
  margin-top: 1rem;
  text-align: center;
  color: var(--td-accent);
}

.td-subhead {
  font-family: var(--td-font-head);
  font-size: clamp(2rem, 5vw, 4rem);
  text-align: center;
  margin: 6rem 0;
  padding: 2rem 0;
  border-top: 1px solid var(--td-border);
  border-bottom: 1px solid var(--td-border);
  color: var(--td-accent);
}

.td-footer {
  text-align: center;
  margin-top: 8rem;
  font-family: "Roboto Mono", monospace;
  font-size: 0.8rem;
  opacity: 0.6;
  color: var(--td-accent);
}

.td-raw-only,
.td-raw-note,
.td-raw-inline,
.td-raw-cap,
.td-raw-foot {
  display: none;
  font-family: "Roboto Mono", monospace;
  color: var(--td-accent);
}

.td-render-cap,
.td-render-foot {
  display: inline-block;
}

.mode-raw .td-raw-only {
  display: inline;
}
.mode-raw .td-raw-cap {
  display: block;
}
.mode-raw .td-raw-foot {
  display: block;
}
.mode-raw .td-render-cap,
.mode-raw .td-render-foot {
  display: none;
}

.mode-raw .td-raw-note {
  display: block;
  font-size: 0.875rem;
  border: 1px dashed var(--td-accent);
  padding: 1rem;
  margin: 2rem 0;
  background: rgba(255, 16, 240, 0.1);
  text-align: left;
  color: var(--td-accent);
}

.mode-raw .td-raw-inline {
  display: inline;
  background: rgba(255, 16, 240, 0.15);
  color: var(--td-accent) !important;
  border: 1px solid var(--td-accent);
  font-size: 0.8em;
  padding: 0 4px;
  vertical-align: middle;
  font-weight: 700;
  margin: 0 5px;
}

.td-glitch-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: exclusion;
}

/* =========================================
   SHARED RESPONSIVE (MOBILE + PORTRAIT TABLET)
   JS-DRIVEN: body.layout-mobile
   ========================================= */

body.layout-mobile {
  --td-safe-top: max(env(safe-area-inset-top, 0px), 0px);
  --td-safe-bottom: max(env(safe-area-inset-bottom, 0px), 0px);
  --td-mobile-nav-height: calc(5.5rem + var(--td-safe-bottom));
}

body.layout-mobile .td-index-item {
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 1.5rem 0;
}
body.layout-mobile .td-idx-thumb-wrapper {
  width: 80px;
  height: 60px;
  grid-column: 2;
  grid-row: 1 / 3;
}
body.layout-mobile .td-idx-issue {
  grid-column: 1;
}
body.layout-mobile .td-idx-title {
  grid-column: 1;
  font-size: 2rem;
}

body.layout-mobile .td-dual-wrapper {
  min-height: 100dvh;
}

body.layout-mobile .td-toggle-ui {
  bottom: calc(var(--td-mobile-nav-height) + 1.5rem);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: max-content;
  border-radius: 50px;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  background-color: var(--td-bg);
  border: 1px solid var(--td-accent);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  mix-blend-mode: normal;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition:
    background-color var(--td-anim-speed) ease,
    border-color var(--td-anim-speed) ease;

  padding: 0.7125rem 1.425rem;
  gap: 1.425rem;
  font-size: 0.7125rem;
}

body.layout-mobile .td-back-btn,
body.layout-mobile .td-mode-btn {
  border-color: var(--td-accent);
  color: var(--td-accent);
  padding: 0.475rem 0.95rem;
}

body.layout-mobile .td-mode-btn {
  width: 114px;
}

body.layout-mobile .td-mode-controls {
  color: var(--td-accent);
}

body.layout-mobile .td-index-container,
body.layout-mobile .td-article-container {
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  min-height: 100dvh;
  padding-top: calc(1.5rem + var(--td-safe-top));
  padding-right: calc(1.5rem + env(safe-area-inset-right, 0px));
  padding-bottom: calc(var(--td-mobile-nav-height) + 1.5rem);
  padding-left: calc(1.5rem + env(safe-area-inset-left, 0px));
}

body.layout-mobile .td-index-header {
  margin-top: 0;
  margin-bottom: 2rem;
}

body.layout-mobile .td-index-header p {
  margin-top: 1rem;
}

body.layout-mobile .td-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
}

body.layout-mobile .td-subhead {
  margin: 3rem 0;
  padding: 1.5rem 0;
}

body.layout-mobile .td-para {
  margin-bottom: 1.5rem;
}

body.layout-mobile .td-figure {
  margin: 2.5rem 0;
}

body.layout-mobile .td-footer {
  margin-top: 4rem;
}

/* =========================================
   TABLET PORTRAIT EXCLUSIVE (+10% PILL SCALE)
   JS-DRIVEN: Mobile layout with min-width guard
   ========================================= */
@media (min-width: 768px) {
  body.layout-mobile .td-toggle-ui {
    padding: 0.9405rem 1.881rem;
    gap: 1.881rem;
    font-size: 0.9405rem;
  }

  body.layout-mobile .td-back-btn,
  body.layout-mobile .td-mode-btn {
    padding: 0.627rem 1.254rem;
  }

  body.layout-mobile .td-mode-btn {
    width: 150.48px;
  }

  body.layout-mobile .td-index-item {
    padding: 1.725rem 0;
    gap: 1.15rem;
  }

  body.layout-mobile .td-idx-thumb-wrapper {
    width: 92px;
    height: 69px;
  }

  body.layout-mobile .td-idx-title {
    font-size: 2.3rem;
  }

  body.layout-mobile .td-idx-issue {
    font-size: 0.92rem;
  }
}

/* =========================================
   LANDSCAPE TABLETS & SMALL LAPTOPS
   JS-DRIVEN: body.layout-landscape-tablet
   ========================================= */

body.layout-landscape-tablet {
  --td-measure: 580px;
}

body.layout-landscape-tablet.mode-raw,
body.layout-landscape-tablet .mode-raw {
  --td-measure: 720px;
}

body.layout-landscape-tablet .td-toggle-ui {
  gap: 1rem;
  font-size: 0.9rem;
  bottom: 1.5rem;
  right: 1.5rem;
}

body.layout-landscape-tablet .td-back-btn,
body.layout-landscape-tablet .td-mode-btn {
  padding: 0.42rem 0.84rem;
}

body.layout-landscape-tablet .td-mode-btn {
  width: 105px;
}

body.layout-landscape-tablet .td-index-header h1 {
  font-size: clamp(3rem, 6vw, 4.5rem);
}

body.layout-landscape-tablet .td-idx-title {
  font-size: clamp(2rem, 3vw, 3rem);
}

body.layout-landscape-tablet .td-title {
  font-size: clamp(4rem, 8vw, 6.5rem);
}

body.layout-landscape-tablet .td-subhead {
  font-size: clamp(2rem, 4vw, 3rem);
}

body.layout-landscape-tablet .td-para {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

body.layout-landscape-tablet .td-index-container,
body.layout-landscape-tablet .td-article-container {
  padding: 4rem 8rem 8rem 6rem;
}

body.layout-landscape-tablet .td-index-container {
  will-change: opacity, transform;
  transform: translateZ(0);
}

body.layout-landscape-tablet .td-header {
  margin-bottom: 4rem;
  padding-bottom: 2.5rem;
}

body.layout-landscape-tablet .td-figure {
  margin: 2.5rem 0;
}

body.layout-landscape-tablet .td-subhead {
  margin: 4rem 0;
  padding: 1.5rem 0;
}

body.layout-landscape-tablet .td-index-list {
  gap: 1rem;
}

body.layout-landscape-tablet .td-index-item {
  gap: 1rem;
  grid-template-columns: 0.5fr 100px 1fr;
}

body.layout-landscape-tablet .td-idx-thumb-wrapper {
  width: 100px;
  height: 66px;
}
