/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.page1 {
    background-color: teal;
    min-height: 100vh;
    width: 100%;
}

/* ===== NAVBAR – Sticky & Responsive ===== */
nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 20vh;
    width: 100%;
    background-color: teal;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    list-style: none;
    transition: all 0.3s ease;
}

/* Logo styles */
nav .logo h1 {
    font-size: 40px;
    color: rgb(20, 20, 20);
    font-family: "Dancing Script", cursive;
    font-weight: 600;
}
nav .logo h1 span {
    color: red;
}
nav .logo p {
    font-size: 20px;
    color: whitesmoke;
    font-family: "Dancing Script", cursive;
    font-weight: 600;
}

/* Navigation links container */
.nav {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
}
.nav li a {
    color: rgb(255, 255, 255);
    text-decoration: none;
    font-size: 20px;
    transition: color 0.2s, transform 0.2s;
}
.nav li a:hover {
    color: #ffd966;
    transform: translateY(-2px);
}
.nav button {
    padding: 8px 14px;
    border: 1px solid white;
    font-size: 15px;
    background: white;
    color: teal;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.nav button:hover {
    background: teal;
    color: white;
    border: 1px solid teal;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* Dropdown – click only (no hover) */
.dropdown {
    position: relative;
}
.dropdown-menu {
    display: none;
    position: absolute;
    background: teal;
    list-style: none;
    padding: 0;
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    top: 100%;
    left: 0;
    min-width: 160px;
    z-index: 100;
}
.dropdown-menu li {
    padding: 10px;
}
/* Show dropdown only when .open class is added by JavaScript */
.dropdown.open .dropdown-menu {
    display: block;
}

/* Hamburger button (hidden on desktop) */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}
.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    margin: 5px 0;
    border-radius: 3px;
    transition: all 0.2s;
}

/* ===== CONTAINER & FILTERS ===== */
.container {
    height: 80vh;
    width: 100%;
    background-color: white;
    overflow-y: auto;
}
.filters {
    display: flex;
    justify-content: flex-end;
    padding: 20px;
    font-size: 20px;
}

/* ===== STORY CARDS ===== */
.story {
    display: flex;
    gap: 20px;
    background: rgb(230, 240, 240);
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 20px;
    align-items: flex-start;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.story:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.1);
}
.story img {
    width: 350px;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}

/*  LABEL STYLING  */


.story h2 .story-label {
    font-size: 2rem;
    font-weight: 600;
    margin-right: 9px;
    text-decoration: none; 
    font-weight: 700;    
}


.story h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 20px 30px;
}

/* Make all story labels (Description:, Full Story:) bold */
.story .story-label {
    font-weight: bold;
}

/* Additional styles for other elements */
.story .meta {
    font-size: 18px;
    margin-bottom: 30px;
    margin-left: 30px;
}
.story .short-desc {
    font-size: 20px;
    margin-bottom: 30px;
    margin-left: 30px;
    
}
.story .full-story {
    line-height: 1.3;
    color: #000000;
    font-size: 17px;
    margin-left: 30px;
    font-family: "Roboto", sans-serif;  /* ensure Roboto */
    font-weight: 400;
    font-style: normal;
}
.read-more-btn {
    margin-top: 10px;
    padding: 8px 14px;
    border: none;
    background: teal;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 30px;
    transition: background 0.2s, transform 0.1s;
}
.read-more-btn:hover {
    background: #006d6d;
    transform: scale(0.98);
}

/* Loader (unchanged) */
.loader {
    width: 80px;
    height: 50px;
    position: relative;
}
.loader-text {
    position: absolute;
    top: 0;
    padding: 0;
    margin: 0;
    color: #C8B6FF;
    animation: text_713 3.5s ease both infinite;
    font-size: .8rem;
    letter-spacing: 1px;
}
.load {
    background-color: #9A79FF;
    border-radius: 50px;
    display: block;
    height: 16px;
    width: 16px;
    bottom: 0;
    position: absolute;
    transform: translateX(64px);
    animation: loading_713 3.5s ease both infinite;
}
.load::before {
    position: absolute;
    content: "";
    width: 100%;
    height: 100%;
    background-color: #D1C2FF;
    border-radius: inherit;
    animation: loading2_713 3.5s ease both infinite;
}
@keyframes text_713 {
    0% { letter-spacing: 1px; transform: translateX(0px); }
    40% { letter-spacing: 2px; transform: translateX(26px); }
    80% { letter-spacing: 1px; transform: translateX(32px); }
    90% { letter-spacing: 2px; transform: translateX(0px); }
    100% { letter-spacing: 1px; transform: translateX(0px); }
}
@keyframes loading_713 {
    0% { width: 16px; transform: translateX(0px); }
    40% { width: 100%; transform: translateX(0px); }
    80% { width: 16px; transform: translateX(64px); }
    90% { width: 100%; transform: translateX(0px); }
    100% { width: 16px; transform: translateX(0px); }
}
@keyframes loading2_713 {
    0% { transform: translateX(0px); width: 16px; }
    40% { transform: translateX(0%); width: 80%; }
    80% { width: 100%; transform: translateX(0px); }
    90% { width: 80%; transform: translateX(15px); }
    100% { transform: translateX(0px); width: 16px; }
}

/* Action buttons row */
.action-buttons {
    margin: 15px 0 0 30px;
    display: flex;
    gap: 15px;
    align-items: center;
}
.like-btn, .comment-toggle-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s;
}
.like-btn {
    background: #fefdfd;
    color: #000000;
}
.like-btn.liked {
    background: #ffffff;
    color: rgb(229, 27, 27);
}
.comment-toggle-btn {
    background: #e0e0e0;
    color: #333;
}

/* Comments section */
.comments-section {
    margin: 15px 0 0 30px;
    border-top: 1px solid #ddd;
    padding-top: 15px;
}
.comments-section h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}
.comments-list {
    margin-bottom: 15px;
}
.comment {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}
.comment-content {
    font-size: 14px;
    margin-bottom: 5px;
}
.comment-date {
    font-size: 11px;
    color: #777;
}
.comment-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
}
.comment-form button {
    margin-top: 8px;
    padding: 6px 12px;
    background: teal;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.no-comments {
    color: #888;
    font-style: italic;
}
.loader-small {
    font-size: 12px;
    color: #666;
    padding: 5px;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */
/* Tablet: reduce image size */
@media (max-width: 992px) {
    .story img {
        width: 250px;
        height: 180px;
    }
    .story h2,
    .story .meta,
    .story .short-desc,
    .story .full-story,
    .read-more-btn {
        margin-left: 20px;
    }
    .story .meta,
    .story .short-desc,
    .story .full-story {
        font-size: 16px;
    }
    .story h2 {
        font-size: 18px;
    }
}

/* Like button */
.like-section {
  margin: 1.5rem 0 1rem;
}
.like-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  transition: all 0.2s ease;
}
.like-btn:hover {
  background-color: #f0f0f0;
}
.like-btn.liked {
  color: #e74c3c;
}
.like-count {
  font-weight: bold;
  margin-left: 0.3rem;
}

/* ===== COMMENTS SECTION – COMPACT & CLEAN ===== */
.comments-section {
    margin-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 1rem;
}

.comments-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.comments-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Individual comment bubble */
.comment {
    background: #ffffff;
    border-radius: 16px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #eef2f6;
}

.comment:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.comment-content {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #1e2a3a;
    word-wrap: break-word;
}

.comment-date {
    font-size: 0.7rem;
    color: #8a9bb0;
    margin-top: 0.4rem;
    letter-spacing: 0.2px;
}

.no-comments {
    color: #8a9bb0;
    font-style: italic;
    text-align: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 16px;
    font-size: 0.85rem;
}

/* Comment form – matches your teal theme */
.comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.comment-form textarea {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    background: #ffffff;
    transition: border 0.2s, box-shadow 0.2s;
}

.comment-form textarea:focus {
    outline: none;
    border-color: teal;
    box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.1);
}

.comment-form button {
    align-self: flex-start;
    background-color: teal;
    color: white;
    border: none;
    border-radius: 40px;
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.comment-form button:hover {
    background-color: #006b6b;
    transform: scale(0.97);
}

/* Loader for comments */
.loader-small {
    text-align: center;
    color: #8a9bb0;
    padding: 1rem;
    font-size: 0.85rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .comments-section h3 {
        font-size: 1rem;
    }
    .comment {
        padding: 0.65rem 0.85rem;
    }
    .comment-content {
        font-size: 0.85rem;
    }
    .comment-date {
        font-size: 0.65rem;
    }
    .comment-form textarea {
        font-size: 0.85rem;
        padding: 0.65rem;
    }
    .comment-form button {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .comments-list {
        max-height: 250px;
    }
    .comment-form textarea {
        font-size: 0.8rem;
    }
}

/* Mobile: stack cards, show hamburger, hide nav links */
@media (max-width: 768px) {
    /* Show hamburger */
    .hamburger {
        display: block;
    }
    /* Hide nav links by default */
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: teal;
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
        z-index: 1000;
    }
    .nav.open {
        display: flex;
    }
    /* Dropdown on mobile */
    .dropdown {
        position: static;
    }
    .dropdown-menu {
        position: static;
        background: rgba(0,0,0,0.1);
        box-shadow: none;
        margin-top: 0.5rem;
        display: none;
    }
    .dropdown.open .dropdown-menu {
        display: block;
    }
    /* Story cards become vertical */
    .story {
        flex-direction: column;
        padding: 1rem;
    }
    .story img {
        width: 100%;
        height: auto;
        max-height: 250px;
    }
    .story h2,
    .story .meta,
    .story .short-desc,
    .story .full-story,
    .read-more-btn {
        margin-left: 0;
    }
    .story h2 {
        margin-top: 0.5rem;
    }
    .filters {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    nav .logo h1 {
        font-size: 1.8rem;
    }
    nav .logo p {
        font-size: 1rem;
    }
}

/* Small phones: fine-tune */
@media (max-width: 480px) {
    .story img {
        max-height: 200px;
    }
    .filters select {
        font-size: 0.9rem;
    }
}

/* Public stories page refinements */
.page1 {
    overflow-x: clip;
}

.page1 .container,
.page1 #storiesContainer,
.page1 .story,
.page1 .story-content {
    min-width: 0;
    max-width: 100%;
}

.page1 .hero,
.page1 .filters {
    width: 100%;
}

.page1 #auth-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page1 #auth-nav > a {
    white-space: nowrap;
}

.page1 .hamburger {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    color: #f6efe1;
}

.page1 .hamburger svg,
.page1 .hero-link svg,
.page1 .action-buttons svg {
    width: 1.25rem;
    height: 1.25rem;
    display: block;
}

.page1 .hamburger svg,
.page1 .hero-link svg,
.page1 .comment-toggle-btn svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.page1 .hero-link {
    gap: 0.75rem;
}

.page1 .story {
    width: 100%;
    overflow: hidden;
}

.page1 .reader-close-btn {
    display: none;
}

.page1 .story.story-expanded {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: block;
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: clamp(20px, 5vw, 64px);
    overflow-x: hidden;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    background: var(--paper);
    box-shadow: none;
}

.page1 .story.story-expanded:hover {
    transform: none;
    box-shadow: none;
}

.page1 .story.story-expanded .story-content {
    width: min(100%, 900px);
    margin: 0 auto;
}

.page1 .story.story-expanded > img {
    display: block;
    width: min(100%, 900px);
    height: clamp(200px, 42vh, 440px);
    margin: 0 auto 2rem;
}

.page1 .story.story-expanded .reader-close-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    margin: 0 0 1.5rem;
    padding: 0.65rem 1rem;
    border: 1px solid var(--sage-line);
    border-radius: var(--radius-pill);
    background: #fff;
    color: var(--ink);
    font: 600 0.9rem var(--font-sans);
    cursor: pointer;
}

.page1 .story.story-expanded .reader-close-btn svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.page1 .story.story-expanded h2 {
    font-size: clamp(2rem, 5vw, 3.25rem);
}

.page1 .story.story-expanded .full-story {
    font-size: clamp(1.05rem, 1.8vw, 1.2rem);
    line-height: 1.95;
}

body.story-reader-open {
    overflow: hidden;
}

.page1 .story img {
    flex: 0 1 34%;
    width: min(34%, 350px);
    max-width: 100%;
    min-width: 0;
    object-fit: cover;
}

.page1 .story-content,
.page1 .story h2,
.page1 .story .meta,
.page1 .story .short-desc,
.page1 .story .story-preview,
.page1 .story .full-story,
.page1 .comment-content {
    overflow-wrap: anywhere;
    word-break: normal;
}

.page1 .story h2 {
    margin-left: 0;
}

.page1 .story .meta,
.page1 .story .short-desc,
.page1 .story .full-story {
    margin-left: 0;
}

.page1 .read-more-btn,
.page1 .action-buttons,
.page1 .comments-section {
    margin-left: 0;
}

.page1 .action-buttons {
    flex-wrap: wrap;
}

.page1 .like-btn,
.page1 .comment-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 42px;
}

.page1 .like-btn svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.page1 .like-btn.liked svg {
    fill: currentColor;
}

.page1 .comment-form textarea {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 768px) {
    .page1 .story {
        flex-direction: column;
        align-items: stretch;
    }

    .page1 .story img {
        flex: none;
        width: 100%;
        height: clamp(180px, 52vw, 320px);
    }
}

@media (max-width: 480px) {
    .page1 .site-nav {
        gap: 0.5rem;
    }

    .page1 .site-nav .logo h1 {
        font-size: clamp(1.2rem, 6vw, 1.55rem);
    }

    .page1 .site-nav .logo p {
        max-width: 34ch;
        line-height: 1.4;
    }

    .page1 .story {
        padding: 16px;
    }

    .page1 .action-buttons {
        gap: 8px;
    }

    .page1 .like-btn,
    .page1 .comment-toggle-btn {
        padding: 8px 12px;
        font-size: 0.82rem;
    }

    .page1 .story.story-expanded {
        padding: 20px 18px;
    }

    .page1 .story.story-expanded > img {
        height: 34vh;
        margin-bottom: 1.5rem;
    }
}