/*
 * Community Bridge Resources - Handcrafted Bulletin Board Design
 * "Community newspaper meets local library bulletin board"
 */

/* ========================================
   CSS VARIABLES - Warm, Paper-like Colors
   ======================================== */
:root {
  /* Primary palette - like aged paper and ink */
  --cbr-ink: #2c3e50;
  --cbr-ink-light: #34495e;
  --cbr-rust: #c0392b;
  --cbr-mustard: #d4a029;
  --cbr-forest: #27ae60;
  --cbr-navy: #2980b9;

  /* Paper and background tones */
  --cbr-paper: #faf8f5;
  --cbr-paper-dark: #f0ebe3;
  --cbr-cream: #fff9e6;
  --cbr-cardboard: #d4c4a8;

  /* Accent colors */
  --cbr-pushpin-red: #e74c3c;
  --cbr-tape-yellow: #f7dc6f;
  --cbr-highlighter: #fff59d;
  --cbr-coffee: #8b5a2b;

  /* Typography */
  --font-display: 'Georgia', 'Times New Roman', serif;
  --font-body: 'Segoe UI', 'Helvetica Neue', sans-serif;
  --font-handwritten: 'Comic Sans MS', 'Marker Felt', cursive;
}

/* ========================================
   PAPER TEXTURE & BASE STYLES
   ======================================== */
body.cbr-site {
  background-color: var(--cbr-paper);
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  font-family: var(--font-body);
  color: var(--cbr-ink);
  line-height: 1.7;
}

/* Coffee stain watermark */
body.cbr-site::after {
  content: '';
  position: fixed;
  bottom: 50px;
  right: 30px;
  width: 120px;
  height: 120px;
  background: radial-gradient(ellipse at center,
    rgba(139, 90, 43, 0.08) 0%,
    rgba(139, 90, 43, 0.05) 40%,
    rgba(139, 90, 43, 0.02) 60%,
    transparent 70%);
  border-radius: 50%;
  transform: rotate(-15deg);
  pointer-events: none;
  z-index: 0;
}

/* ========================================
   HEADER - Paper Texture with Pushpins
   ======================================== */
.site-header {
  background-color: var(--cbr-cream) !important;
  background-image:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h60v60H0z' fill='none'/%3E%3Cpath d='M30 30m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0' fill='%23d4c4a8' opacity='0.3'/%3E%3C/svg%3E");
  border-bottom: 3px solid var(--cbr-cardboard) !important;
  box-shadow: 0 4px 0 rgba(0,0,0,0.05), 0 8px 20px rgba(0,0,0,0.08);
  position: relative;
}

.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.5) 0%, transparent 100%);
  pointer-events: none;
}

/* Navigation - Different hover effects for each item */
.primary-menu > li > a {
  font-family: var(--font-display) !important;
  font-weight: 600 !important;
  color: var(--cbr-ink) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  position: relative;
  transition: all 0.2s ease;
}

.primary-menu > li:nth-child(1) > a:hover {
  color: var(--cbr-rust) !important;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 4px;
}

.primary-menu > li:nth-child(2) > a:hover {
  background: var(--cbr-highlighter) !important;
  padding: 4px 8px;
  margin: -4px -8px;
}

.primary-menu > li:nth-child(3) > a:hover {
  color: var(--cbr-pushpin-red) !important;
  transform: rotate(-2deg);
  display: inline-block;
}

.primary-menu > li:nth-child(4) > a:hover {
  color: var(--cbr-forest) !important;
  border-bottom: 3px dotted var(--cbr-forest);
}

.primary-menu > li:nth-child(5) > a:hover {
  background: var(--cbr-tape-yellow) !important;
  transform: rotate(1deg);
}

.primary-menu > li:nth-child(6) > a:hover,
.primary-menu > li:nth-child(7) > a:hover {
  color: var(--cbr-navy) !important;
  text-decoration: underline;
}

/* ========================================
   TORN PAPER EDGE EFFECT
   ======================================== */
.torn-edge {
  position: relative;
}

.torn-edge::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 0;
  right: 0;
  height: 15px;
  background: linear-gradient(135deg, var(--cbr-paper) 25%, transparent 25%),
              linear-gradient(225deg, var(--cbr-paper) 25%, transparent 25%),
              linear-gradient(315deg, var(--cbr-paper) 25%, transparent 25%),
              linear-gradient(45deg, var(--cbr-paper) 25%, transparent 25%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 0, 10px -10px, 0px 10px;
}

/* ========================================
   CARDS - Bulletin Board Notes Style
   ======================================== */
.bulletin-card {
  background: #fff;
  border: none;
  border-radius: 2px;
  padding: 24px 28px;
  position: relative;
  box-shadow:
    2px 3px 0 rgba(0,0,0,0.1),
    4px 6px 15px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Torn paper edge on cards */
.bulletin-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background:
    linear-gradient(135deg, transparent 33.33%, #fff 33.33%, #fff 66.66%, transparent 66.66%),
    linear-gradient(45deg, transparent 33.33%, #fff 33.33%, #fff 66.66%, transparent 66.66%);
  background-size: 12px 8px;
  transform: translateY(-8px);
}

/* Pushpin decoration */
.bulletin-card.has-pushpin::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: radial-gradient(circle at 30% 30%, #ff6b6b 0%, var(--cbr-pushpin-red) 50%, #a82828 100%);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Yellow sticky note variant */
.sticky-note {
  background: linear-gradient(180deg, #fff9c4 0%, #fff59d 100%);
  transform: rotate(-1deg);
  box-shadow:
    3px 3px 0 rgba(0,0,0,0.1),
    5px 8px 20px rgba(0,0,0,0.1);
}

.sticky-note:hover {
  transform: rotate(0deg) translateY(-4px);
}

/* Index card variant */
.index-card {
  background: #fff;
  border-top: 4px solid var(--cbr-navy);
  position: relative;
}

.index-card::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    #ccc,
    #ccc 100%
  );
  opacity: 0.5;
}

/* ========================================
   TYPOGRAPHY - Intentionally Inconsistent
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--cbr-ink);
  line-height: 1.3;
}

/* Varying h2 sizes - intentional inconsistency */
.section-header h2 {
  font-size: 32px;
}

.resource-section h2 {
  font-size: 28px;
  border-bottom: 2px dotted var(--cbr-cardboard);
  padding-bottom: 12px;
}

.tool-section h2 {
  font-size: 30px;
  position: relative;
  display: inline-block;
}

/* Hand-drawn underline effect */
.hand-underline {
  position: relative;
  display: inline-block;
}

.hand-underline::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: -5%;
  width: 110%;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20'%3E%3Cpath d='M3 12 C20 8, 40 16, 60 10 C80 4, 100 14, 120 9 C140 4, 160 13, 180 8 C190 6, 195 10, 197 9' stroke='%23c0392b' stroke-width='3' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

/* Hand-drawn circle emphasis */
.hand-circle {
  position: relative;
}

.hand-circle::before {
  content: '';
  position: absolute;
  top: -15px;
  left: -20px;
  right: -20px;
  bottom: -15px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 8 C75 6, 94 25, 92 50 C90 75, 72 94, 48 92 C24 90, 6 72, 8 48 C10 24, 28 10, 50 8' stroke='%23d4a029' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  pointer-events: none;
  z-index: -1;
}

/* ========================================
   BUTTONS - Handmade Feel
   ======================================== */
.btn-primary {
  background: var(--cbr-rust) !important;
  color: #fff !important;
  border: none;
  padding: 14px 28px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  border-radius: 3px;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
  transform: rotate(-0.5deg);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary:hover {
  transform: rotate(0deg) translateY(-2px);
  box-shadow: 4px 5px 0 rgba(0,0,0,0.2);
  background: #a93226 !important;
}

.btn-secondary {
  background: transparent;
  color: var(--cbr-ink);
  border: 2px dashed var(--cbr-cardboard);
  padding: 12px 24px;
  font-family: var(--font-display);
  border-radius: 0;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--cbr-cream);
  border-style: solid;
  transform: rotate(1deg);
}

.btn-emergency {
  background: var(--cbr-pushpin-red) !important;
  color: #fff !important;
  border: none;
  padding: 16px 32px;
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 2px;
  box-shadow: 4px 4px 0 #8b0000;
  animation: subtle-pulse 2s infinite;
}

@keyframes subtle-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* ========================================
   BORDERS - Mixed Styles
   ======================================== */
.border-dotted {
  border: 2px dotted var(--cbr-cardboard);
}

.border-solid {
  border: 3px solid var(--cbr-ink);
}

.border-dashed {
  border: 2px dashed var(--cbr-rust);
}

.border-double {
  border: 4px double var(--cbr-navy);
}

.border-none {
  border: none;
}

/* ========================================
   HERO SECTIONS - Newspaper Style
   ======================================== */
.newspaper-hero {
  background: var(--cbr-cream);
  border-bottom: 4px double var(--cbr-ink);
  padding: 60px 20px 80px;
  text-align: center;
  position: relative;
}

.newspaper-hero::before {
  content: '★ COMMUNITY BULLETIN ★';
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--cbr-ink-light);
  text-transform: uppercase;
}

.newspaper-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: -1px;
}

.newspaper-hero .subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--cbr-ink-light);
  max-width: 600px;
  margin: 0 auto;
}

/* Decorative rule */
.decorative-rule {
  width: 200px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--cbr-ink), transparent);
  margin: 20px auto;
  position: relative;
}

.decorative-rule::before {
  content: '◆';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--cbr-cream);
  padding: 0 10px;
  color: var(--cbr-ink);
  font-size: 12px;
}

/* ========================================
   QUICK ACTION CARDS - Bulletin Notes
   ======================================== */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
}

@media (max-width: 900px) {
  .quick-actions-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }
}

.quick-action-card {
  background: #fff;
  padding: 28px;
  text-align: center;
  position: relative;
  box-shadow: 3px 4px 0 rgba(0,0,0,0.1), 0 8px 25px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  text-decoration: none;
  display: block;
}

.quick-action-card:nth-child(1) {
  transform: rotate(-2deg);
  background: linear-gradient(180deg, #ffebee 0%, #ffcdd2 100%);
  border-left: 5px solid var(--cbr-pushpin-red);
}

.quick-action-card:nth-child(2) {
  transform: rotate(1deg);
  background: linear-gradient(180deg, #e3f2fd 0%, #bbdefb 100%);
  border-left: 5px solid var(--cbr-navy);
}

.quick-action-card:nth-child(3) {
  transform: rotate(-1deg);
  background: linear-gradient(180deg, #e8f5e9 0%, #c8e6c9 100%);
  border-left: 5px solid var(--cbr-forest);
}

.quick-action-card:hover {
  transform: rotate(0deg) translateY(-8px) !important;
  box-shadow: 5px 8px 0 rgba(0,0,0,0.12), 0 15px 40px rgba(0,0,0,0.15);
}

.quick-action-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--cbr-ink);
}

.quick-action-card p {
  font-size: 15px;
  color: var(--cbr-ink-light);
  line-height: 1.6;
}

/* Tape decoration on cards */
.tape-top::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 60px;
  height: 20px;
  background: rgba(247, 220, 111, 0.8);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ========================================
   RESOURCE CATEGORIES - Corkboard Style
   ======================================== */
.corkboard {
  background:
    url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='1' fill='%238b7355' opacity='0.3'/%3E%3C/svg%3E"),
    linear-gradient(135deg, #c9a86c 0%, #a08050 100%);
  padding: 60px 20px;
  border: 12px solid #5d4e37;
  border-radius: 4px;
  box-shadow: inset 0 0 50px rgba(0,0,0,0.2), 0 10px 30px rgba(0,0,0,0.3);
}

.category-card {
  background: #fff;
  padding: 24px;
  margin: 10px;
  position: relative;
  box-shadow: 2px 3px 8px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

/* Different tilt for each card */
.category-card:nth-child(1) { transform: rotate(-1.5deg); }
.category-card:nth-child(2) { transform: rotate(1deg); }
.category-card:nth-child(3) { transform: rotate(-0.5deg); }
.category-card:nth-child(4) { transform: rotate(2deg); }
.category-card:nth-child(5) { transform: rotate(-1deg); }
.category-card:nth-child(6) { transform: rotate(0.5deg); }

.category-card:hover {
  transform: rotate(0deg) scale(1.03) !important;
  z-index: 10;
  box-shadow: 4px 6px 20px rgba(0,0,0,0.25);
}

/* Pushpin on cards */
.category-card::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 20px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.category-card:nth-child(1)::before { background: radial-gradient(circle at 30% 30%, #ff8a80, #d32f2f); }
.category-card:nth-child(2)::before { background: radial-gradient(circle at 30% 30%, #82b1ff, #1976d2); }
.category-card:nth-child(3)::before { background: radial-gradient(circle at 30% 30%, #b9f6ca, #388e3c); }
.category-card:nth-child(4)::before { background: radial-gradient(circle at 30% 30%, #ffcc80, #f57c00); }
.category-card:nth-child(5)::before { background: radial-gradient(circle at 30% 30%, #ea80fc, #8e24aa); }
.category-card:nth-child(6)::before { background: radial-gradient(circle at 30% 30%, #80deea, #00838f); }

/* ========================================
   NEWSLETTER - Newspaper Clipping Style
   ======================================== */
.newsletter-section {
  background: var(--cbr-cream);
  padding: 50px 30px;
  margin: 40px auto;
  max-width: 600px;
  border: 1px solid var(--cbr-ink);
  position: relative;
  transform: rotate(0.5deg);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.1);
}

.newsletter-section::before {
  content: '✂ CUT HERE';
  position: absolute;
  top: -12px;
  left: 20px;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--cbr-ink-light);
  background: var(--cbr-paper);
  padding: 0 10px;
}

.newsletter-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--cbr-ink) 0, var(--cbr-ink) 5px, transparent 5px, transparent 10px);
}

/* ========================================
   TOOLS - Index Card Style
   ======================================== */
.tool-card {
  background: #fff;
  border-top: 6px solid var(--cbr-forest);
  padding: 30px;
  position: relative;
  box-shadow: 2px 3px 0 rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

/* Lined paper effect */
.tool-card::after {
  content: '';
  position: absolute;
  top: 40px;
  left: 30px;
  right: 30px;
  bottom: 30px;
  background: repeating-linear-gradient(
    transparent,
    transparent 27px,
    #e0e0e0 27px,
    #e0e0e0 28px
  );
  pointer-events: none;
  opacity: 0.5;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 4px 6px 0 rgba(0,0,0,0.12);
}

/* ========================================
   RESOURCE ITEMS - Library Card Style
   ======================================== */
.resource-item {
  background: #fff;
  border-left: 4px solid;
  padding: 20px 24px;
  margin-bottom: 16px;
  position: relative;
  box-shadow: 1px 2px 0 rgba(0,0,0,0.08);
}

.resource-item:nth-child(odd) {
  border-left-color: var(--cbr-navy);
  transform: rotate(-0.3deg);
}

.resource-item:nth-child(even) {
  border-left-color: var(--cbr-forest);
  transform: rotate(0.3deg);
}

.resource-item:hover {
  transform: rotate(0deg);
  background: var(--cbr-cream);
}

/* ========================================
   FORMS - Handwritten Feel
   ======================================== */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  background: #fff;
  border: 2px solid var(--cbr-cardboard);
  border-radius: 0;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 16px;
  transition: all 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--cbr-ink);
  box-shadow: 3px 3px 0 var(--cbr-cream);
}

/* Checkbox like a ballot */
input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--cbr-ink);
  border-radius: 0;
  cursor: pointer;
  position: relative;
}

input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: -2px;
  left: 2px;
  font-size: 18px;
  color: var(--cbr-rust);
  font-weight: bold;
}

/* ========================================
   FOOTER - Newspaper Footer
   ======================================== */
.site-footer {
  background: var(--cbr-paper-dark) !important;
  border-top: 4px double var(--cbr-ink);
  padding: 40px 20px;
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--cbr-ink) 0,
    var(--cbr-ink) 2px,
    transparent 2px,
    transparent 8px
  );
}

/* ========================================
   HAND-DRAWN ARROW DECORATION
   ======================================== */
.hand-arrow {
  display: inline-block;
  width: 80px;
  height: 30px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40'%3E%3Cpath d='M5 22 C15 19, 25 25, 35 20 C45 15, 55 23, 65 18 C75 13, 82 20, 88 17' stroke='%23c0392b' stroke-width='3' stroke-linecap='round' fill='none'/%3E%3Cpath d='M80 10 C84 14, 88 17, 95 15 M88 17 C86 22, 85 27, 82 32' stroke='%23c0392b' stroke-width='3' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.rotate-left { transform: rotate(-2deg); }
.rotate-right { transform: rotate(2deg); }
.rotate-slight-left { transform: rotate(-0.5deg); }
.rotate-slight-right { transform: rotate(0.5deg); }

.paper-shadow {
  box-shadow: 3px 4px 0 rgba(0,0,0,0.1), 0 8px 25px rgba(0,0,0,0.08);
}

.highlight {
  background: linear-gradient(180deg, transparent 60%, var(--cbr-highlighter) 60%);
  padding: 0 4px;
}

.tape-corner::before {
  content: '';
  position: absolute;
  top: -5px;
  right: 10px;
  width: 40px;
  height: 18px;
  background: rgba(247, 220, 111, 0.7);
  transform: rotate(45deg);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 768px) {
  .newspaper-hero h1 {
    font-size: 2rem;
  }

  .quick-action-card,
  .category-card {
    transform: none !important;
    margin: 15px 0;
  }

  .corkboard {
    border-width: 6px;
    padding: 30px 15px;
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  body.cbr-site::after,
  .tape-top::before,
  .category-card::before {
    display: none;
  }

  .bulletin-card,
  .quick-action-card,
  .category-card {
    transform: none !important;
    box-shadow: none !important;
    border: 1px solid #ccc;
  }
}
