/* main-styles.css - External stylesheet for Drum Corps World main page
   This file should be saved as "css/main-styles.css" */

/* Custom scrollbars */
::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 7px;
}

::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: rgba(0, 0, 0, .5);
    box-shadow: 0 0 1px rgba(255, 255, 255, .5);
}

/* CSS Variables for theming */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --secondary-text: #666666;
    --accent-color: #c41e3a;
    --border-color: #e0e0e0;
    --card-bg: #f8f9fa;
    --shadow: rgba(0, 0, 0, 0.1);
    --progress-width: 12px;
    --progress-radius: 8px;
    --anchor-offset: 20px;
    --white-trim: 4px;
}

/* Dark mode based on browser preference */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;	
        --text-color: #e0e0e0;
        --secondary-text: #b0b0b0;
        --accent-color: #ff4757;
        --border-color: #333333;
        --card-bg: #2d2d2d;
        --shadow: rgba(0, 0, 0, 0.3);
    }
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.7;
  color: var(--text-color);
  background: var(--bg-color);
  transition: background-color .2s ease, color .2s ease;
}

/* Side Panel Styles */
.side-panel {
  position: fixed;
  top: 0;
  left: -320px; /* Hidden by default */
  width: 320px;
  height: 100vh;
  background: #ffffff;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  transition: left 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
}

.side-panel.open {
  left: 0;
}

.side-panel-header {
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.side-panel-header h2 {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  font-size: 1.5em;
  color: #333;
}

.side-panel-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  color: #666;
  padding: 5px;
  line-height: 1;
}

.side-panel-close:hover {
  color: #333;
}

.side-panel-content {
  padding: 20px;
}

.side-panel-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-panel-nav li {
  margin-bottom: 10px;
}

.side-panel-nav a {
  display: block;
  padding: 12px 15px;
  text-decoration: none;
  color: #333;
  background: #f8f9fa;
  border-radius: 5px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.side-panel-nav a:hover {
  background: #e9ecef;
  color: #007bff;
  transform: translateX(5px);
}

.side-panel-section {
  margin-bottom: 30px;
}

.side-panel-section h3 {
  margin: 0 0 15px 0;
  font-family: 'Oswald', sans-serif;
  color: #555;
  font-size: 1.1em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Toggle Button */
.side-panel-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  background: #007bff;
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 123, 255, 0.3);
  transition: all 0.3s ease;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
}

.side-panel-toggle:hover {
  background: #0056b3;
  transform: scale(1.05);
}

.side-panel-toggle.panel-open {
  left: 340px; /* Move when panel is open */
}

/* Overlay */
.side-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
}

.side-panel-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Dark mode support for side panel */
@media (prefers-color-scheme: dark) {
  .side-panel {
    background: #1a1a1a;
    color: #e0e0e0;
  }
  
  .side-panel-header {
    background: #2d2d2d;
    border-color: #404040;
  }
  
  .side-panel-header h2 {
    color: #e0e0e0;
  }
  
  .side-panel-close {
    color: #ccc;
  }
  
  .side-panel-close:hover {
    color: #fff;
  }
  
  .side-panel-nav a {
    background: #2d2d2d;
    color: #e0e0e0;
  }
  
  .side-panel-nav a:hover {
    background: #404040;
    color: #4dabf7;
  }
  
  .side-panel-section h3 {
    color: #ccc;
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .side-panel {
    width: 280px;
    left: -280px;
  }
  
  .side-panel-toggle.panel-open {
    left: 300px;
  }
  
  .side-panel-toggle {
    top: 15px;
    left: 15px;
    width: 45px;
    height: 45px;
  }
}

/* Ensure main content shifts when panel is open on larger screens */
@media (min-width: 1024px) {
  body.side-panel-open .container {
    margin-left: 320px;
    transition: margin-left 0.3s ease;
  }
  
  body.side-panel-open .side-panel-overlay {
    display: none;
  }
}

/* Quick links styling */
.quick-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-link {
  padding: 8px 12px;
  background: #f1f3f4;
  border-radius: 4px;
  font-size: 0.9em;
  transition: background 0.2s ease;
  text-decoration: none;
  color: #333;
}

.quick-link:hover {
  background: #e8f0fe;
}

@media (prefers-color-scheme: dark) {
  .quick-link {
    background: #333;
    color: #e0e0e0;
  }
  
  .quick-link:hover {
    background: #404040;
  }
}

/* CONTAINER - ENFORCED MAX WIDTH */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* Header styles */
.header {
    background: linear-gradient(135deg, var(--accent-color), #8b1f3a);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px var(--shadow);
}

.header h1 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header p {
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    opacity: 0.9;
}

/* Article styles */
.article {
  background: var(--bg-color);
  text-align: left;
  
  /* Use a font-size that's relative to user's preferences */
  font-size: large; /* CSS keyword that scales with user settings */
}
.first-paragraph::first-letter {
    font-family: 'Brush Script MT', cursive;
    font-size: 3em;
    float: left;
    line-height: 0.8;
    margin: 0.1em 0.1em 0 0;
}

/* Responsive adjustment for very small screens */
@media (max-width: 768px) {
  .article {
    font-size: large; /* Larger on mobile, but still scales with user prefs */
  }
}
.article p {
    margin-bottom: 1.2rem;
    text-indent: 1.5em;
}

.article p:first-child {
    text-indent: 0;
}

.byline {
    font-style: italic;
    color: var(--secondary-text);
    text-align: center;
    margin: 2rem 0;
    font-size: 0.95rem;
}

* Headlines - Professional serif font stack */
:root {
    /* Replace the narrow font with a professional serif stack */
    --headline-font: "Times New Roman", Times, "Liberation Serif", 
                     "Nimbus Roman No9 L", serif;
    --headline-color: #111;
}

@media (prefers-color-scheme: dark) {
    :root { 
        --headline-color: #fff; 
    }
}

h1:not(.visually-hidden-anchor),
.byline h1 {
    font-family: var(--headline-font);
    font-weight: 700; /* Slightly bolder than before */
    font-style: normal;
    line-height: 1.2; /* Increased from 1.08 for better readability */
    letter-spacing: 0.002em;
    color: var(--headline-color);
    font-size: clamp(2.1rem, 7vw, 3.5rem); /* Increased base size */
    margin: 0 0 .25rem 0;
}

.byline h1 { 
    font-style: normal;
    font-size: clamp(1.2rem, 3.6vw, 1.9rem) !important; /* Increased size */
}
/* Image styles */
.image-container {
    width: 100%;
    max-width: 100%;
    margin: 1.5rem auto;
    text-align: center;
}

.responsive-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin: 0 auto;
}

.responsive-image:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px var(--shadow);
}

.image-caption {
    text-align: center;
    font-style: italic;
    color: var(--secondary-text);
    font-size: 0.9rem;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0 1rem;
}

.image-placeholder {
    background: linear-gradient(45deg, var(--border-color), var(--card-bg));
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem auto;
    text-align: center;
    color: var(--secondary-text);
    font-style: italic;
    font-size: 0.9rem;
    max-width: 100%;
}

/* Dark mode image trimming */
@media (prefers-color-scheme: dark) {
    .image-container > .responsive-image,
    .imageflex > img {
        clip-path: inset(var(--white-trim));
    }
}

.no-trim { 
    clip-path: none !important; 
}

/* Image flex layout */
.imageflex {
    --ifx-w: clamp(88px, 24vw, 160px);
    --ifx-gap: 12px;
    --ifx-gap-start: 0;
    --ifx-gap-end: var(--ifx-gap);
    display: block;
    flow-root: auto;
}

.imageflex img {
    float: left;
    width: var(--ifx-w);
    height: auto;
    margin-block-end: 8px;
    margin-inline-start: var(--ifx-gap-start);
    margin-inline-end: var(--ifx-gap-end);
    border-radius: 6px;
    box-shadow: 0 2px 8px var(--shadow);
}

.imageflex::after {
    content: "";
    display: table;
    clear: both;
}

.imageflex[data-side="right"] {
    --ifx-gap-start: var(--ifx-gap);
    --ifx-gap-end: 0;
}

.imageflex[data-side="right"] img {
    float: right;
}

.imageflex[data-size="sm"] { --ifx-w: 100px; }
.imageflex[data-size="md"] { --ifx-w: 140px; }
.imageflex[data-size="lg"] { --ifx-w: 200px; }
.imageflex[data-size="fluid"] { --ifx-w: clamp(96px, 28vw, 240px); }

/* Divider utility */
.divider {
    margin: 1rem 0;
}

/* Clickable snippets */
.clickable-snippet {
    cursor: pointer;
    position: relative;
}

.clickable-snippet:focus {
    outline: 3px solid var(--border-color);
    outline-offset: 3px;
}

.clickable-snippet:hover {
    outline: 2px solid var(--border-color);
    outline-offset: 2px;
}

@media (hover:none) {
    .clickable-snippet:hover {
        outline: none;
    }
}

/* Staff directory */
.staff-list {
    margin-top: 1rem;
}

.staff-entry {
    display: list-item;
    list-style: disc;
    margin-left: 1.25rem;
    margin-bottom: 0.5rem;
}

/* Copyright text */
.copyright-text p {
    margin-bottom: 1rem;
    text-indent: 2em;
    text-align: justify;
}

.copyright-text p:first-child {
    text-indent: 2em;
}

/* Feedback Form Styles */
.feedback-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow);
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.submit-btn:hover {
    background: #a31729;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.submit-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .feedback-form-container {
        padding: 1rem;
        margin: 0 1rem;
    }
    
    .submit-btn {
        align-self: stretch;
    }
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow);
}

.scroll-to-top.visible {
    display: flex;
}

/* Progress bar - FULL HEIGHT and positioned at far right edge */
.progress-track {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 2px; /* Far right edge */
    width: 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    z-index: 1001;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1); /* Shadow to left */
}

@media (prefers-color-scheme: dark) {
    .progress-track {
        background: rgba(255, 255, 255, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.3);
    }
}

/* Firefox-specific: hide default scrollbar when our custom one is active */
@-moz-document url-prefix() {
    html {
        scrollbar-width: none;
    }
    
    body {
        scrollbar-width: none;
    }
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: #dc2626;
    border-radius: 5px;
    height: 25%;
    transition: height 0.2s ease;
    min-height: 4px;
}

@media (prefers-color-scheme: dark) {
    .progress-fill {
        background: #ef4444;
    }
}

.progress-thumb {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #dc2626;
    border: 2px solid white;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: top 0.2s ease;
}

.progress-thumb:active {
    cursor: grabbing;
}

@media (prefers-color-scheme: dark) {
    .progress-thumb {
        background: #ef4444;
        border: 2px solid #1a1a1a;
    }
}

/* Utility classes */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.visually-hidden-anchor {
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(100%);
    white-space: nowrap;
}

/* Anchor offset for sticky headers */
body :where([id]) { 
    scroll-margin-top: var(--anchor-offset); 
}

body :where([id]):target::before {
    content: "";
    display: block;
    height: var(--anchor-offset);
    margin-top: calc(-1 * var(--anchor-offset));
    visibility: hidden;
}

h1 { 
    scroll-margin-top: var(--sticky-offset, 20px); 
}

/* iOS Safari sticky header fixes - keeping for progress bar */
@supports (-webkit-touch-callout: none) {
    .progress-track {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
    }
}

/* Responsive breakpoints */
@media (max-width: 768px) {
    .container {
        padding: 1rem 20px 1rem 16px; /* More padding on right to account for progress bar */
    }

    .article {
        text-align: left;
    }

    .image-container {
        margin: 1rem auto;
    }

    .responsive-image {
        border-radius: 4px;
    }

    .image-caption {
        font-size: 0.8rem;
        padding: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    .imageflex img { 
        width: clamp(88px, 24vw, 160px); 
    }
    
    .header {
        padding: 1rem 0;
    }
    
    .container {
        padding: 0.5rem 18px 0.5rem 12px; /* Asymmetric padding to account for progress bar */
    }

    .article p {
        text-indent: 0;
    }

    .image-container {
        margin: 0.75rem auto;
    }

    .responsive-image:hover {
        transform: none;
    }
}

/* Prevent scroll anchoring */
html, body, main, .content, .container, [role="main"], [data-scroll] { 
    overflow-anchor: none; 
}

/* Print styles */
@media print {
    .header {
        background: none !important;
        color: black !important;
    }
    
    .scroll-to-top, .progress-track, .side-panel, .side-panel-toggle, .side-panel-overlay {
        display: none !important;
    }
    
    .responsive-image {
        box-shadow: none !important;
        border: 1px solid #ccc;
    }
		
	
}
/* Add this to your main-styles.css file */

/* Thumbnail ad styling for mobile */
.ad-thumbnail {
    padding: 2rem 1rem;
    background: var(--bg-color);
    text-align: center;
}

.ad-thumbnail .responsive-image {
    width: auto;
    max-width: 80%;
    max-height: 450px;
    margin: 0 auto;
    box-shadow: 0 2px 8px var(--shadow);
    border-radius: 4px;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .ad-thumbnail {
        padding: 1.5rem 0.5rem;
    }
    
    .ad-thumbnail .responsive-image {
        max-width: 80%;
        max-height: 350px;
    }
}

@media (max-width: 480px) {
    .ad-thumbnail {
        padding: 1rem 0.5rem;
    }
    
    .ad-thumbnail .responsive-image {
        max-width: 90%;
        max-height:350px;
    }
}