/* =============================================================
   TBM Shared Styles — unified refactor v1.3.1
   Goal: one source of truth for global UI + media components.
   Page-specific CSS (e.g., viewer) should NOT duplicate these.
   -------------------------------------------------------------
   Sections
   1) Reset & Base
   2) Layout & Typography
   3) Navigation & Header
   4) User Menu
   5) Buttons (canonical)
   5) Cards (dashboard grid)
   7) Shared Media Component (.story-media)
   8) Story View Containers
   9) Footer
  10) Responsive
   ============================================================= */

/* =============================
   1) RESET & BASE
   ============================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    height: 100%;
}

body {
    font-family: "Quicksand", sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
    line-height: 1.6;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #E65300;
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    text-decoration: underline;
    color: #E65300;
}

b {
    color: #E65300;
    text-decoration: none;
    font-weight: bold;
}

blockquote {
    border-left: 4px solid #ff6600;
    padding-left: 15px;
    margin: 15px 0;
    font-style: italic;
    color: #555;
    background: #f9f9f9;
}

/* Layout container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem;
}

/* =============================
   2) LAYOUT & TYPOGRAPHY (CONNECTED TO SUMMER NOTE -OB 9.14.25)
   ============================= */
h1 {
    font-family: "Quicksand", sans-serif;
    font-optical-sizing: auto;
	font-size: 36px;
    font-weight: 600;
    font-style: normal;
    color: #000;
}

h2 {
	font-size: 34px;
    font-weight: 600;
	color: #000;    
}

h3 {
	font-size: 30px;
}

h4 {
	font-size: 26px;
	color: #000;
}

h5 {
	font-size: 24px;
	color: #E65300;
}

h6 {
	font-size: 22px;
    font-style: italic;
}

ul {
  list-style-type: disc;
  margin: 1em 0;
  padding-left: 2em;
  line-height: 1.5;
}

ul li::marker {
  color: #E65300;
  font-size: 1.1em;
}

ol {
  list-style-type: decimal;
  margin: 1em 0;
  padding-left: 2em;
  line-height: 1.5;
}

ol li::marker {
  color: #E65300;
  font-weight: bold;
}


/* =============================
   3) NAVIGATION & HEADER
   ============================= */
nav.side-nav {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background-image: linear-gradient(45deg, #F09819 10%, #E65300 100%);
    color: #fff;
    padding: 2rem 1rem;
    box-shadow: 2px 0 5px rgba(0,0,0,0.3);
    transition: left 0.3s ease; z-index: 999;
}

nav.side-nav ul { list-style: none; }
nav.side-nav li { margin: 1rem 0; }
nav.side-nav a { color: #fff; text-decoration: none; font-size: 1.2rem; }
nav.side-nav a:hover { color: #222222; }
nav.side-nav.open { left: 0; }

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 0;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #222222;
}

#menu-toggle { background: none; border: none; cursor: pointer; padding: 0; }
#menu-toggle img { width: 30px; height: 30px; transition: transform 0.3s ease, filter 0.3s ease; }
#menu-toggle:hover img { filter: invert(1); }

header {
    background-image: linear-gradient(45deg, #E65300 10%, #F09819 100%);
    border-bottom: 2px solid #ccc;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-inner h1 {
    color: #fff;
}

.header-inner a {
    text-decoration: none;
}

.header-inner a:hover {
    text-decoration: none;
}

.user-icon {
    font-size: 1px;
    position: relative;
}

.user-icon img {
    width: 30px;
    height: 30px;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.user-icon:hover img {
    filter: invert(1);
}

/* Hover Tooltip */
.user-icon:hover::after {
    content: "My Account";
    background: #ffa500; /* fallback color */
    background: rgba(255, 165, 0, 0.85);
    color: #fff;
    font-size: 11px;
    position: absolute;
    top: 50%;
    left: 110%;
    transform: translateY(-50%);
    padding: 3px 10px;
    border-radius: 60px;
    border-bottom-left-radius: 0;
    white-space: nowrap;
}


/* =============================
   4) BUTTONS (CANONICAL)
   ============================= */
.button {
    padding: 15px 30px;
    text-align: center;
    transition: 0.5s;
    background-size: 200% auto;
    color: #fff;
    border-radius: 4px;
    display: inline-block;
    border: 0;
    font-weight: 700;
    box-shadow: 0 0 14px -7px #f09819;
    background-image: linear-gradient(45deg, #FF512F 0%, #F09819 51%, #FF512F 100%);
    cursor: pointer;
    user-select: none; -webkit-user-select: none; touch-action: manipulation;
    font-size: 16px;
    line-height: 1;
}

.button:hover {
    background-position: right center;
    color: #fff;
    text-decoration: none;
}

.button:active {
    transform: scale(0.95);
}

.button--publish {
    background-image: linear-gradient(45deg, #4ade80 0%, #15803d 51%, #4ade80 100%);
}

.button--danger {
    background-image: linear-gradient(45deg, #f87171 0%, #991b1b 51%, #f87171 100%);
}

.button-label {
    cursor: pointer;
  }
  
@media (max-width: 640px) {
  .button {
    display: block;
    margin: 0 auto 1px auto; /* smaller gap */
    width: auto;
    text-align: center;
    line-height: 1; /* ensures no extra vertical space */
  }
}

/* =============================
   5) USER MENU DROPDOWN
   ============================= */

.user-menu-wrapper {
    position: relative;
    display: inline-block;
}

.user-icon {
    cursor: pointer;
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 120%;
    background-image: linear-gradient(45deg, #F09819 10%, #E65300 100%);
    color: #fff;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    border: 1px solid #d87200;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    z-index: 9999;
    min-width: 180px;
    font-size: 0.95rem;
    text-align: left;
}

.user-dropdown, 
.user-dropdown * {
    color: #000;
}

.user-dropdown li {
    padding: 10px 18px;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.user-dropdown li:hover {
    background-color: rgba(255,255,255,0.1);
}

.user-dropdown li.full-name {
    font-weight: 700;
    font-size: 1rem;
    cursor: default;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    margin-bottom: 5px;
    padding-bottom: 8px;
}

/* Show menu when wrapper has .open */
.user-menu-wrapper.open .user-dropdown {
    display: block;
}


/* =============================
   6) CARDS (dashboard grid)
   ============================= */
.story-card {
    max-height: 300px;
    min-height: 325px;
    padding: 0;
    border-radius: 6px;
    position: relative;
    text-align: center;
    cursor: pointer;
    border-top: 4px solid transparent;
    transition: border-top 0.2s ease, background-color 0.2s ease;
}

.story-card:hover {
    border-top: 4px solid #E65300;
    background-color: #f5f5f5;
}

.story-card h3 {
	font-weight: 800;
	font-size: 18px;
	text-align: center;
	font-style: normal;
	margin: 5px;
}

.story-meta {
    color: #555;
    font-size: 11px;
}
.story-card .icon {
    margin-right: 0.3rem;
}

/* When cards adopt .story-media wrapper, preserve spacing */
.story-card .story-media {
    border-radius: 4px 4px 0 0;
    margin-bottom: 10px;
}


/* =============================
   7) CARD THUMBNAILS
   ============================= */
.story-media {
    width: 100%;
    display: block;
    overflow: hidden;
    border-radius: 10px;
}

.story-media img,
.story-media video,
.story-media iframe,
.story-media audio {
    display: block;
    width: 100%;
}

/* CARD THUMBNAIL: Home Page and User Dashboard */
.story-media--thumb {
    aspect-ratio: 16 / 9;
}

.story-media--thumb img,
.story-media--thumb video,
.story-media--thumb iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 4px 4px 0 0;
}

/* Audio Preview */
.story-media audio {
    width: 100%;
    position: absolute;
    left: 20%;
    top: 20%;
    transform: translate(-20%, -20%);
}

/* =============================
   8) STORY VIEW CONTAINER
   ============================= */
.story-view {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 30px;
}

.story-view p {
    margin: 1rem 0;
    line-height: 1.5;
}

.story-view img {
    display: inline-block;
    margin: 20px;
    vertical-align: top;
    max-width: 100%;
    border-radius: 6px;
    height: auto;
}

/* Story View toolbars (Edit / Back to Dashboard) */
#viewer-actions,
.viewer-actions {
    width: 100%;
    max-width: 1100px;
    margin: 20px auto 10px auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
    align-items: center;
}

.media-container {
    width: 100%;
    max-width: 1100px;
    display: block;
    text-align: center;
}

/* HOW THE IMAGE APPEARS WHEN VIEWING A STORY */
.media-container img {
    width: 100%;
    height: 40vh;
    border-radius: 6px;
    object-fit: cover;
}

/* HOW THE IFRAME (EMBED VIDEO) APPEARS WHEN VIEWING A STORY */
.media-container iframe {
    width: 100%;
    height: 50vh;
    border-radius: 6px;
    object-fit: cover;
}

/* HOW THE AUDIO TOOL APPEARS WHEN VIEWING A STORY */
.media-container audio {
    width: 850px;
}

/* HOW THE VIDEO TOOL APPEARS WHEN VIEWING A STORY */
.media-container video {
    width: 100%;
    height: 40vh;
    border-radius: 6px;
    object-fit: cover;
}

@media (max-width: 640px) {
  .media-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 1rem auto;
    padding: 0;                /* remove side padding */
    text-align: left;          /* kill centering offset */
    overflow-x: hidden;
  }

  .media-container img,
  .media-container video,
  .media-container iframe {
    display: block;
    margin: 0 auto;
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 6px;
    object-fit: contain;
  }
}


/* Utility: stretch link across card */
.stretched-link { position: absolute; inset: 0; z-index: 10; opacity: 0; cursor: pointer; }

/* =============================
   9) FOOTER
   ============================= */
footer {
    background-image: linear-gradient(45deg, #E65300 10%, #F09819 100%);
    color: #fff;
    padding: 1rem 0;
    flex-shrink: 0;
    margin-top: auto;
}

footer b {
    color: #fff;
}

footer a {
    color: #fff;
    text-decoration: none;
}

footer a:hover {
    color: #222
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.footer-left p { margin: 0.2rem 0; }
.footer-right a { color: #fff; margin-left: 1rem; text-decoration: none; }
.footer-right a:hover { color: #222;
}

/* ===== Responsive Footer ===== */
@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
    padding: 1rem;
  }

  .footer-left p {
    margin: 0.25rem 0;
  }

  footer b {
    display: block;
    margin-bottom: 0.25rem;
  }

  .footer-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0.5rem;
    line-height: 1;      /* reset inherited spacing */
  }

  .footer-right a {
    display: block;
    margin: 0;           /* no vertical margin */
    padding: 0;          /* no internal padding */
    font-size: 0.9rem;
    line-height: 1;      /* collapse lines */
  }

  /* Completely eliminate extra gap between links */
  .footer-right a + a {
    margin-top: -2px;
  }
}

/* =============================
10)   MESSAGES
   ============================= */
.tbm-msg {
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    border-radius: 5px;
    max-width: 1100px;
}

/* ✅ Success - green */
.tbm-msg.success {
    background-color: #d8f8d8;
    color: #205c20;
    border: 1px solid #b6e6b6;
}

/* ✅ Warning - yellow/orange */
.tbm-msg.warning {
    background-color: #fff8d8;
    color: #8a6d00;
    border: 1px solid #ffe58f;
}

/* ✅ Error - red */
.tbm-msg.error {
    background-color: #fddcdc;
    color: #842424;
    border: 1px solid #f5b7b7;
}


/* =============================
   11) RESPONSIVE
   ============================= */
@media (max-width: 768px) {
  .header-inner { display: flex; justify-content: space-between; align-items: center; }
  #menu-toggle { order: 1; }
  h1 { order: 2; font-size: 24px; text-align: center; flex: 1; }
  .user-icon { order: 3; }

  .hero img { width: 100%; max-width: 500px; }
  .hero h2 { font-size: 36px; line-height: 1; }
  .about-grid { flex-direction: column; }
  .back-top { display: inline-block; }
  #closeModal { display: none; }
}

@media (max-width: 640px) {
  .story-view {
    padding: 0 1rem 30px 1rem; /* add side margins while keeping bottom spacing */
    max-width: 100%;
    box-sizing: border-box;
  }
}