/* =====================================================================
   macro-sector.css — Stock Capsule Macro Sector Page Styles
   OPTION B LAYOUT: Logo + Date on left, Content on right
   
   CRITICAL: This file loads AFTER homepage.css and must override it
   Using !important and higher specificity to ensure styles apply
   ===================================================================== */

/* ============================================================
   Content Container - White Box Wrapper
   ============================================================ */
.macro-sector-page .content-container {
    background: #ffffff !important;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(17,17,17,0.05);
    margin: 0 auto;
}

/* ============================================================
   Macro Sector Page Wrapper
   ============================================================ */
.macro-sector-page {
  width: 92% !important;
  max-width: 1180px !important;
  margin: 28px auto !important;
  padding: 18px !important;
  background: #f8f9fa !important;
}

/* ============================================================
   Macro Sector Header
   ============================================================ */
.macro-sector-header-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.macro-sector-header {
    width: 60%;
    max-width: 720px;
    text-align: center;
    padding: 28px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 14px;
    color: white;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25);
}

.macro-sector-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: white;
    letter-spacing: -0.02em;
}

.macro-sector-description {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-weight: 400;
}

/* ============================================================
   Filings Grid - Higher Specificity
   ============================================================ */
.macro-sector-page .homepage-grid {
  display: block !important;
  gap: 18px;
}

/* =====================================================================
   OPTION B CARD LAYOUT - OVERRIDE HOMEPAGE STYLES
   Using .macro-sector-page prefix for higher specificity
   ===================================================================== */
.macro-sector-page .filing-card {
  background: #ffffff !important;
  border: 1px solid #e8e8e8 !important;
  border-radius: 14px !important;
  padding: 14px 18px !important;
  margin-bottom: 12px !important;
  box-shadow: 0 2px 12px rgba(17,17,17,0.05) !important;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease !important;
  
  /* Flexbox layout: Logo+Date on left, Content on right */
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  min-height: 100px !important;
  max-height: 106px !important;
}

.macro-sector-page .filing-card:hover {
  transform: translateX(4px) !important;
  box-shadow: 0 8px 28px rgba(17,17,17,0.1) !important;
  border-color: #667eea !important;
}

/* =====================================================================
   LEFT SECTION: Logo + Date Stacked - FORCE OVERRIDE
   ===================================================================== */
.macro-sector-page .filing-left-section {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
}

.macro-sector-page .company-logo {
  width: 75px !important;
  height: 65px !important;
  object-fit: contain !important;
  border-radius: 10px !important;
  flex-shrink: 0 !important;
  padding: 6px !important;
  background: #f8f9fa !important;
  border: 1px solid #e9ecef !important;
}

.macro-sector-page .filing-date-below-logo {
  font-size: 11px !important;
  color: #64748B !important;
  text-align: center !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  display: block !important;
}

/* =====================================================================
   RIGHT SECTION: 3 Content Lines - FORCE OVERRIDE
   ===================================================================== */
.macro-sector-page .filing-right-section {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  min-width: 0 !important;
}

/* Line 1: Tags (Filing Type + Stock Cap) */
.macro-sector-page .filing-tags {
  display: flex !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  margin-bottom: 0 !important;
}

.macro-sector-page .filing-type-tag,
.macro-sector-page .stock-cap-tag {
  display: inline-block !important;
  color: white !important;
  font-weight: 700 !important;
  font-size: 10px !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  padding: 3px 10px !important;
  border-radius: 12px !important;
  line-height: 1.2 !important;
}

.macro-sector-page .filing-type-tag {
  background: linear-gradient(135deg, #FF3131 0%, #ff6b6b 100%) !important;
}

.macro-sector-page .stock-cap-tag {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Line 2: Headline */
.macro-sector-page .filing-card h2,
.macro-sector-page .filing-title {
  font-size: 16px !important;
  margin: 0 !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  color: #1a1a1a !important;
  
  /* Truncate to 1 line on web */
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.macro-sector-page .filing-card h2 a,
.macro-sector-page .filing-title a { 
  color: #1a1a1a !important;
  text-decoration: none !important;
  transition: color 0.2s ease !important;
}

.macro-sector-page .filing-card h2 a:hover,
.macro-sector-page .filing-title a:hover { 
  color: #667eea !important;
}

/* Line 3: Company Name + Industry (Horizontal) */
.macro-sector-page .filing-meta-line {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: none !important;
}

.macro-sector-page .filing-meta-item {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 12px !important;
  color: #64748B !important;
  font-weight: 500 !important;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.macro-sector-page .filing-meta-item.company-name {
  font-weight: 600 !important;
  color: #2D3748 !important;
}

.macro-sector-page .filing-meta-item svg {
  width: 13px !important;
  height: 13px !important;
  flex-shrink: 0 !important;
  opacity: 0.7 !important;
}

.macro-sector-page .meta-separator {
  color: #CBD5E0 !important;
  font-weight: 400 !important;
  font-size: 12px !important;
}

/* =====================================================================
   HIDE OLD STYLES - FORCE OVERRIDE
   ===================================================================== */
.macro-sector-page .filing-logo-title {
  display: none !important;
}

.macro-sector-page .filing-meta-info {
  display: none !important;
}

.macro-sector-page .filing-company {
  display: none !important;
}

/* Pagination */
.macro-sector-page .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0 20px 0;
    padding: 20px 0;
}

.macro-sector-page .pagination a,
.macro-sector-page .pagination span {
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    background: white;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
    font-weight: 500;
}

.macro-sector-page .pagination a:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.macro-sector-page .pagination .current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    font-weight: 600;
}

/* No Results */
.macro-sector-page .no-results {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 14px;
    margin: 40px 0;
}

.macro-sector-page .no-results p {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

.macro-sector-page .reset-filters-link {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.macro-sector-page .reset-filters-link:hover {
    transform: translateY(-2px);
}

/* ============================================================
   Responsive - Desktop/Tablet (≤992px)
   ============================================================ */
@media (max-width: 992px) {
    .macro-sector-page .content-container {
        padding: 20px !important;
    }
    
    .macro-sector-header {
        width: 70%;
        padding: 24px 28px;
    }
    
    .macro-sector-title {
        font-size: 28px;
    }
    
    .macro-sector-description {
        font-size: 15px;
    }
    
    .macro-sector-page {
        width: 96% !important;
        margin: 20px auto !important;
        padding: 14px !important;
    }

    .macro-sector-page .filing-card {
        padding: 12px 16px !important;
        margin-bottom: 10px !important;
        min-height: 95px !important;
        max-height: 102px !important;
    }

    .macro-sector-page .company-logo {
        width: 70px !important;
        height: 60px !important;
    }

    .macro-sector-page .filing-title {
        font-size: 15px !important;
    }

    .macro-sector-page .filing-meta-item {
        font-size: 11px !important;
    }
}

/* ============================================================
   Responsive - Mobile (≤768px)
   ============================================================ */
@media (max-width: 768px) {
    .macro-sector-page .content-container {
        padding: 18px !important;
    }
    
    .macro-sector-header {
        width: 85%;
        padding: 20px 24px;
    }
    
    .macro-sector-title {
        font-size: 24px;
    }
    
    .macro-sector-description {
        font-size: 14px;
    }
    
    .macro-sector-page {
        width: 98% !important;
        margin: 16px auto !important;
        padding: 12px !important;
    }

    .macro-sector-page .filing-card {
        padding: 10px 12px !important;
        margin-bottom: 10px !important;
        gap: 10px !important;
        min-height: auto !important;
        max-height: none !important;
    }

    .macro-sector-page .company-logo {
        width: 58px !important;
        height: 52px !important;
    }

    .macro-sector-page .filing-date-below-logo {
        font-size: 9px !important;
    }

    .macro-sector-page .filing-right-section {
        gap: 4px !important;
    }

    .macro-sector-page .filing-tags {
        gap: 4px !important;
    }

    .macro-sector-page .filing-type-tag,
    .macro-sector-page .stock-cap-tag {
        font-size: 8px !important;
        padding: 3px 7px !important;
    }

    /* Allow headline to wrap to 2 lines on mobile with proper text wrapping */
    .macro-sector-page .filing-title {
        font-size: 13px !important;
        line-height: 1.4 !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        max-width: 100% !important;
        /* Remove line-clamp to show full text */
        display: block !important;
        -webkit-line-clamp: unset !important;
        -webkit-box-orient: unset !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    .macro-sector-page .filing-meta-line {
        gap: 5px !important;
    }

    .macro-sector-page .filing-meta-item {
        font-size: 10px !important;
    }

    .macro-sector-page .filing-meta-item svg {
        width: 11px !important;
        height: 11px !important;
    }

    .macro-sector-page .pagination {
        gap: 6px;
        margin: 30px 0 15px 0;
    }

    .macro-sector-page .pagination a,
    .macro-sector-page .pagination span {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* ============================================================
   Responsive - Small Mobile (≤480px)
   ============================================================ */
@media (max-width: 480px) {
    .macro-sector-page .content-container {
        padding: 16px !important;
        border-radius: 12px;
    }
    
    .macro-sector-header {
        width: 95%;
        padding: 18px 20px;
    }
    
    .macro-sector-title {
        font-size: 22px;
    }
    
    .macro-sector-page {
        width: 100% !important;
        margin: 12px auto !important;
        padding: 8px !important;
    }

    .macro-sector-page .filing-card {
        padding: 10px !important;
        margin-bottom: 10px !important;
        border-radius: 12px !important;
        gap: 8px !important;
    }

    .macro-sector-page .filing-left-section {
        gap: 3px !important;
    }

    .macro-sector-page .company-logo {
        width: 52px !important;
        height: 48px !important;
        padding: 3px !important;
    }

    .macro-sector-page .filing-date-below-logo {
        font-size: 8px !important;
    }

    .macro-sector-page .filing-right-section {
        gap: 3px !important;
    }

    .macro-sector-page .filing-tags {
        gap: 3px !important;
    }

    .macro-sector-page .filing-type-tag,
    .macro-sector-page .stock-cap-tag {
        font-size: 7px !important;
        padding: 2px 6px !important;
    }

    /* Full headline display on small mobile with proper wrapping */
    .macro-sector-page .filing-title {
        font-size: 12px !important;
        line-height: 1.35 !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        max-width: 100% !important;
        /* Remove line-clamp to show full text */
        display: block !important;
        -webkit-line-clamp: unset !important;
        -webkit-box-orient: unset !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    .macro-sector-page .filing-meta-line {
        gap: 4px !important;
    }

    .macro-sector-page .filing-meta-item {
        font-size: 9px !important;
    }

    .macro-sector-page .filing-meta-item svg {
        width: 10px !important;
        height: 10px !important;
    }

    .macro-sector-page .meta-separator {
        font-size: 9px !important;
    }
}

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
    .macro-sector-header-container,
    .sc-filter-wrapper {
        display: none;
    }
    
    .macro-sector-page .filing-card {
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        min-height: auto !important;
        max-height: none !important;
    }

    .macro-sector-page .filing-card:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    .macro-sector-page .filing-title {
        white-space: normal !important;
    }

    .macro-sector-page .pagination {
        display: none;
    }
}