/*
 * Roofing Blog Styles - FULLY RESPONSIVE
 * Brand Colors: Primary #5B9942, Secondary #F5D10D, Text #222222
 * Mobile First + Tablet + Desktop + Large Screens
 */

/* ===================================
   CSS VARIABLES - Brand Colors
   =================================== */
:root {
  --primary: #5B9942;
  --primary-light: #7BB75E;
  --primary-dark: #4A7D35;
  --primary-subtle: rgba(91, 153, 66, 0.05);
  
  --secondary: #F5D10D;
  --secondary-light: #FFF4B3;
  --secondary-dark: #D4B00A;
  
  --text: #222222;
  --text-light: #555555;
  --text-lighter: #777777;
  
  --success: #5B9942;
  --warning: #F5D10D;
  --danger: #dc3545;
  
  --bg-white: #ffffff;
  --bg-gray: #f9f9f9;
  --border-gray: #e0e0e0;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ===================================
   QUICK ANSWER CARD - Fully Responsive
   =================================== */
.quick-answer-card {
  background: var(--bg-white);
  border-left: 4px solid var(--primary);
  padding: 1.5rem;
  border-radius: 8px;
  margin: 1.5rem 0 2rem 0;
  box-shadow: var(--shadow-sm);
}

.quick-answer-card h4 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quick-answer-card p {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  font-weight: 400;
}

/* Mobile */
@media (max-width: 480px) {
  .quick-answer-card {
    padding: 1rem;
    margin: 1rem 0 1.5rem 0;
  }
  
  .quick-answer-card h4 {
    font-size: 0.9375rem;
  }
  
  .quick-answer-card p {
    font-size: 0.9375rem;
  }
}

/* ===================================
   KEY TAKEAWAYS BOX - Fully Responsive
   =================================== */
.key-takeaways-box {
  background: var(--bg-gray);
  border-left: 4px solid var(--primary);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.key-takeaways-box h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--primary-dark);
  font-size: 1.25rem;
}

.takeaways-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.takeaways-list li {
  padding: 0.5rem 0;
  padding-left: 1.75rem;
  position: relative;
  color: var(--text);
  line-height: 1.6;
  font-size: 1rem;
}

.takeaways-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
  font-size: 1.25rem;
}

/* Mobile */
@media (max-width: 480px) {
  .key-takeaways-box {
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
  }
  
  .key-takeaways-box h3 {
    font-size: 1.125rem;
  }
  
  .takeaways-list li {
    font-size: 0.9375rem;
    padding-left: 1.5rem;
  }
}

/* ===================================
   INFO CARD - Fully Responsive
   =================================== */
.info-card-inline {
  background: var(--bg-gray);
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
}

.info-card-inline h4 {
  color: var(--primary-dark);
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.75rem;
}

.info-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  background: var(--bg-white);
  border-radius: 6px;
  border-left: 3px solid var(--primary);
}

.info-label {
  font-size: 0.875rem;
  color: var(--text-light);
  font-weight: 500;
}

.info-value {
  font-size: 1.125rem;
  color: var(--primary);
  font-weight: 700;
}

/* Tablet */
@media (max-width: 768px) {
  .info-card-inline {
    padding: 1rem;
  }
  
  .info-card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .info-card-inline {
    padding: 0.875rem;
    margin: 1.5rem 0;
  }
  
  .info-card-inline h4 {
    font-size: 1rem;
  }
  
  .info-card-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================================
   ARTICLE CONTAINER - Fully Responsive
   =================================== */
.roofing-article {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  line-height: 1.7;
}

.roofing-article h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.roofing-article h2 {
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}

/* Remove top margin from first H2 */
.roofing-article > h2:first-of-type {
  margin-top: 0 !important;
}

.roofing-article h3 {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.roofing-article p {
  font-size: 1.0625rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
  color: var(--text);
}

/* Tablet */
@media (max-width: 768px) {
  .roofing-article {
    padding: 0 1rem;
  }
  
  .roofing-article h1 {
    font-size: 2rem;
    margin-bottom: 1.25rem;
  }
  
  .roofing-article h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
  }
  
  .roofing-article h3 {
    font-size: 1.25rem;
    margin-top: 1.75rem;
  }
  
  .roofing-article p {
    font-size: 1rem;
    line-height: 1.7;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .roofing-article {
    padding: 0 0.875rem;
  }
  
  .roofing-article h1 {
    font-size: 1.375rem;
    line-height: 1.3;
    margin-bottom: 1rem;
  }
  
  .entry-title {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
  }
  
  .roofing-article h2 {
    font-size: 1.375rem;
    margin-top: 2rem;
    margin-bottom: 0.875rem;
  }
  
  .roofing-article h3 {
    font-size: 1.125rem;
    margin-top: 1.5rem;
  }
  
  .roofing-article p {
    font-size: 0.9375rem;
    margin-bottom: 1rem;
  }
}

/* Large Screens */
@media (min-width: 1200px) {
  .roofing-article {
    max-width: 900px;
  }
}

/* ===================================
   COMPARISON TABLES - Fully Responsive
   =================================== */
.table-wrapper {
  margin: 2rem 0;
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.roofing-comparison-table {
  width: 100%;
  min-width: 500px; /* Prevents too much squishing */
  border-collapse: collapse;
  background: var(--bg-white);
  font-size: 0.9375rem;
}

.roofing-comparison-table thead {
  background: var(--primary);
  color: white;
}

.roofing-comparison-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.025em;
  border-bottom: 2px solid var(--primary-dark);
}

.roofing-comparison-table tbody tr {
  border-bottom: 1px solid var(--border-gray);
  transition: background-color 0.2s ease;
}

.roofing-comparison-table tbody tr:nth-child(even) {
  background: var(--bg-gray);
}

.roofing-comparison-table tbody tr:hover {
  background: var(--primary-subtle);
}

.roofing-comparison-table td {
  padding: 0.875rem 1rem;
  color: var(--text);
}

.roofing-comparison-table td:first-child {
  font-weight: 500;
  color: var(--text);
}

/* Tablet */
@media (max-width: 768px) {
  .table-wrapper {
    margin: 1.5rem -1rem; /* Extend to screen edges */
    border-radius: 0;
  }
  
  .roofing-comparison-table {
    font-size: 0.875rem;
    min-width: 450px;
  }
  
  .roofing-comparison-table th,
  .roofing-comparison-table td {
    padding: 0.75rem 0.5rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .roofing-comparison-table {
    font-size: 0.8125rem;
    min-width: 400px;
  }
  
  .roofing-comparison-table th,
  .roofing-comparison-table td {
    padding: 0.625rem 0.5rem;
  }
}

/* ===================================
   PROS & CONS CARDS - Fully Responsive
   =================================== */
.pros-cons-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

.pros-card,
.cons-card {
  background: var(--bg-white);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.pros-card {
  border-top: 4px solid var(--success);
}

.cons-card {
  border-top: 4px solid var(--danger);
}

.pros-card h3 {
  color: var(--success);
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

.cons-card h3 {
  color: var(--danger);
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

.pros-list,
.cons-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pros-list li,
.cons-list li {
  padding: 0.5rem 0;
  padding-left: 1.75rem;
  position: relative;
  color: var(--text);
  line-height: 1.6;
}

.pros-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: bold;
  font-size: 1.125rem;
}

.cons-list li::before {
  content: "✗";
  position: absolute;
  left: 0;
  color: var(--danger);
  font-weight: bold;
  font-size: 1.125rem;
}

/* Tablet */
@media (max-width: 768px) {
  .pros-cons-container {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
  }
  
  .pros-card,
  .cons-card {
    padding: 1.25rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .pros-card,
  .cons-card {
    padding: 1rem;
  }
  
  .pros-card h3,
  .cons-card h3 {
    font-size: 1.125rem;
  }
  
  .pros-list li,
  .cons-list li {
    font-size: 0.9375rem;
  }
}

/* ===================================
   IMAGES - Fully Responsive
   =================================== */
.roofing-image {
  margin: 2.5rem 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.roofing-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.roofing-image:hover img {
  transform: scale(1.02);
}

.roofing-image figcaption {
  padding: 0.875rem 1rem;
  background: var(--bg-gray);
  color: var(--text-light);
  font-size: 0.9375rem;
  font-style: italic;
  text-align: center;
}

/* Tablet */
@media (max-width: 768px) {
  .roofing-image {
    margin: 2rem -1rem; /* Extend to screen edges */
    border-radius: 0;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .roofing-image {
    margin: 1.5rem -0.875rem;
  }
  
  .roofing-image figcaption {
    padding: 0.75rem 0.875rem;
    font-size: 0.875rem;
  }
  
  .roofing-image:hover img {
    transform: none; /* Disable hover effect on mobile */
  }
}

/* ===================================
   CALLOUT BOXES - Fully Responsive
   =================================== */
.callout-box {
  border-left: 4px solid var(--primary);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 6px;
  background: var(--bg-gray);
  box-shadow: var(--shadow-sm);
}

.callout-box h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--primary-dark);
  font-size: 1.125rem;
}

.callout-box p {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.callout-box.tip {
  border-left-color: var(--primary);
  background: var(--primary-subtle);
}

.callout-box.warning {
  border-left-color: var(--warning);
  background: rgba(245, 209, 13, 0.05);
}

.callout-box.danger {
  border-left-color: var(--danger);
  background: rgba(220, 53, 69, 0.05);
}

/* Tablet */
@media (max-width: 768px) {
  .callout-box {
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
  }
  
  .callout-box h3 {
    font-size: 1.0625rem;
  }
  
  .callout-box p {
    font-size: 0.9375rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .callout-box {
    padding: 0.875rem 1rem;
    margin: 1rem 0;
  }
  
  .callout-box h3 {
    font-size: 1rem;
  }
  
  .callout-box p {
    font-size: 0.875rem;
  }
}

/* ===================================
   FAQ SECTION - Fully Responsive
   =================================== */
.faq-section {
  margin: 3rem 0;
  padding: 0;
  background: transparent;
  border: none;
}

.faq-section > h2 {
  color: var(--primary-dark);
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
}

.faq-item {
  background: var(--bg-white);
  border-radius: 6px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
  border-left: 4px solid var(--primary);
}

.faq-item:hover {
  box-shadow: var(--shadow-md);
}

.faq-question {
  font-size: 16px !important;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  padding: 0.65rem 1.25rem;
  cursor: pointer;
  position: relative;
  padding-right: 2.5rem;
  transition: color 0.2s ease;
}

.faq-question::after {
  content: "+";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.0rem;
  color: var(--primary);
  font-weight: 700;
  transition: transform 0.3s ease;
}

.faq-item:hover .faq-question {
  color: var(--primary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background: var(--bg-white);
}

.faq-answer p {
  padding: 0 1.25rem 1rem 1.25rem;
  margin: 0;
  color: var(--text-light);
  line-height: 1.6;
  font-size: 0.9375rem;
}

.faq-item.active .faq-question::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

/* Tablet */
@media (max-width: 768px) {
  .faq-section {
    margin: 2.5rem 0;
  }
  
  .faq-section > h2 {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
  }
  
  .faq-question {
    font-size: 15px !important;
    padding: 0.625rem 1rem;
    padding-right: 2.25rem;
  }
  
  .faq-question::after {
    right: 1rem;
  }
  
  .faq-answer p {
    padding: 0 1rem 0.875rem 1rem;
    font-size: 0.875rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .faq-section {
    margin: 2rem 0;
  }
  
  .faq-section > h2 {
    font-size: 1.375rem;
    margin-bottom: 1rem;
  }
  
  .faq-item {
    margin-bottom: 15px;
  }
  
  .faq-question {
    font-size: 14px !important;
    padding: 0.5rem 0.875rem;
    padding-right: 2rem;
  }
  
  .faq-question::after {
    right: 0.875rem;
    font-size: 0.9rem;
  }
  
  .faq-answer p {
    padding: 0 0.875rem 0.75rem 0.875rem;
    font-size: 0.8125rem;
  }
}

/* ===================================
   PROBLEMS SECTION - Fully Responsive
   =================================== */
.problems-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.problem-item {
  background: var(--bg-white);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border-gray);
  border-top: 5px solid var(--primary);
  box-shadow: var(--shadow-sm);
}

.problem-item:nth-child(2) {
  border-top-color: var(--secondary);
}

.problem-item:nth-child(3) {
  border-top-color: var(--danger);
}

.problem-item h4 {
  margin-top: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-gray);
  font-size: 18px;
}

.problem-item p {
  margin: 0.5rem 0;
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Tablet */
@media (max-width: 768px) {
  .problems-section {
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 25px 0;
  }
  
  .problem-item {
    padding: 16px;
  }
  
  .problem-item h4 {
    font-size: 17px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .problems-section {
    gap: 12px;
    margin: 20px 0;
  }
  
  .problem-item {
    padding: 14px;
  }
  
  .problem-item h4 {
    font-size: 16px;
    padding-bottom: 8px;
  }
  
  .problem-item p {
    font-size: 0.875rem;
  }
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
  .roofing-article {
    max-width: 100%;
    padding: 0;
  }
  
  .roofing-comparison-table {
    box-shadow: none;
    border: 1px solid var(--border-gray);
  }
  
  .pros-cons-container {
    page-break-inside: avoid;
  }
  
  .faq-answer {
    max-height: none !important;
  }
  
  .roofing-image {
    page-break-inside: avoid;
  }
}

/* ===================================
   ACCESSIBILITY
   =================================== */
.roofing-article a {
  color: var(--primary);
  text-decoration: underline;
  transition: color 0.2s ease;
}

.roofing-article a:hover {
  color: var(--primary-dark);
}

.roofing-article a:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===================================
   UTILITY CLASSES
   =================================== */

/* Text alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Mobile-only visibility */
@media (min-width: 769px) {
  .mobile-only { display: none !important; }
}

/* Desktop-only visibility */
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
}

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {
  /* Larger tap targets for touch devices */
  .faq-question {
    min-height: 44px; /* iOS recommended minimum */
  }
  
  .resource-link {
    min-height: 44px;
  }
  
  /* Disable hover effects on touch */
  .roofing-image:hover img {
    transform: none;
  }
  
  .resource-link:hover {
    transform: none;
  }
}