/**
 * WordPress Core Blocks Styles
 * 
 * Base styling for native WordPress Gutenberg blocks
 * Provides container, spacing, and typography for headless frontends
 * 
 * @package Headless_API
 */

/* ================================================================
   CONTAINER & LAYOUT
   ================================================================ */

/* Max-width container for content blocks */
.wp-block-container,
.wp-block {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 768px) {
    .wp-block-container,
    .wp-block {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Full-width blocks */
.alignfull {
    max-width: 100% !important;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* Wide blocks */
.alignwide {
    max-width: 1400px;
}

/* Alignment utilities */
.alignleft {
    float: left;
    margin-right: 2rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.aligncenter {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Clear floats */
.wp-block::after,
.entry-content::after {
    content: "";
    display: table;
    clear: both;
}

/* ================================================================
   TYPOGRAPHY - HEADINGS
   ================================================================ */

.wp-block-heading,
h1.wp-block-heading,
h2.wp-block-heading,
h3.wp-block-heading,
h4.wp-block-heading,
h5.wp-block-heading,
h6.wp-block-heading {
    font-weight: 700;
    line-height: 1.2;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #1a202c;
}

h1.wp-block-heading {
    font-size: 2.5rem;
    margin-top: 0;
}

h2.wp-block-heading {
    font-size: 2rem;
}

h3.wp-block-heading {
    font-size: 1.75rem;
}

h4.wp-block-heading {
    font-size: 1.5rem;
}

h5.wp-block-heading {
    font-size: 1.25rem;
}

h6.wp-block-heading {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    h1.wp-block-heading { font-size: 2rem; }
    h2.wp-block-heading { font-size: 1.75rem; }
    h3.wp-block-heading { font-size: 1.5rem; }
    h4.wp-block-heading { font-size: 1.25rem; }
}

/* ================================================================
   TYPOGRAPHY - PARAGRAPHS
   ================================================================ */

.wp-block-paragraph,
p.wp-block-paragraph {
    margin-bottom: 1.5rem;
    line-height: 1.7;
    font-size: 1rem;
    color: #4a5568;
}

/* Drop cap */
.wp-block-paragraph.has-drop-cap:first-letter {
    float: left;
    font-size: 4rem;
    line-height: 0.8;
    margin: 0.1em 0.1em 0 0;
    font-weight: 700;
}

/* ================================================================
   QUOTES & PULLQUOTES
   ================================================================ */

.wp-block-quote,
.wp-block-pullquote {
    margin: 2rem auto;
    padding: 1.5rem 2rem;
    border-left: 4px solid #3b82f6;
    background: #f7fafc;
    font-style: italic;
}

.wp-block-quote p,
.wp-block-pullquote p {
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #2d3748;
}

.wp-block-quote cite,
.wp-block-pullquote cite {
    display: block;
    font-size: 0.875rem;
    font-style: normal;
    color: #718096;
    margin-top: 1rem;
}

.wp-block-quote cite::before,
.wp-block-pullquote cite::before {
    content: "— ";
}

/* Pullquote specific */
.wp-block-pullquote {
    border-left: none;
    border-top: 4px solid #3b82f6;
    border-bottom: 4px solid #3b82f6;
    text-align: center;
    padding: 2rem;
}

.wp-block-pullquote p {
    font-size: 1.5rem;
    font-weight: 600;
}

/* ================================================================
   LISTS
   ================================================================ */

.wp-block-list,
ul.wp-block-list,
ol.wp-block-list {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.wp-block-list li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
    color: #4a5568;
}

ul.wp-block-list {
    list-style-type: disc;
}

ol.wp-block-list {
    list-style-type: decimal;
}

/* Nested lists */
.wp-block-list ul,
.wp-block-list ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ================================================================
   TABLES
   ================================================================ */

.wp-block-table {
    margin: 2rem auto;
    overflow-x: auto;
}

.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.wp-block-table th,
.wp-block-table td {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.wp-block-table thead th {
    background-color: #f7fafc;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 2px solid #cbd5e0;
}

.wp-block-table tbody tr:nth-child(even) {
    background-color: #f7fafc;
}

.wp-block-table tbody tr:hover {
    background-color: #edf2f7;
}

/* Table variations */
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
    background-color: #f7fafc;
}

.wp-block-table.is-style-stripes tbody tr:nth-child(even) {
    background-color: #ffffff;
}

/* Responsive tables */
@media (max-width: 768px) {
    .wp-block-table {
        overflow-x: scroll;
    }
    
    .wp-block-table table {
        min-width: 600px;
    }
}

/* ================================================================
   CODE BLOCKS
   ================================================================ */

.wp-block-code,
code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
}

.wp-block-code {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 2rem 0;
}

.wp-block-code code {
    background: transparent;
    color: inherit;
}

/* Inline code */
code {
    background: #edf2f7;
    color: #e53e3e;
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
}

/* Preformatted text */
.wp-block-preformatted {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    margin: 2rem 0;
}

/* ================================================================
   IMAGES & MEDIA
   ================================================================ */

.wp-block-image {
    margin: 2rem 0;
}

.wp-block-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

.wp-block-image.aligncenter img {
    margin-left: auto;
    margin-right: auto;
}

.wp-block-image figcaption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #718096;
    text-align: center;
    font-style: italic;
}

/* ================================================================
   SEPARATOR
   ================================================================ */

.wp-block-separator,
hr.wp-block-separator {
    border: none;
    border-top: 2px solid #e2e8f0;
    margin: 3rem auto;
    max-width: 100px;
}

.wp-block-separator.is-style-wide {
    max-width: 100%;
}

.wp-block-separator.is-style-dots {
    border: none;
    text-align: center;
    max-width: none;
}

.wp-block-separator.is-style-dots::before {
    content: "···";
    color: #cbd5e0;
    font-size: 1.5rem;
    letter-spacing: 1rem;
}

/* ================================================================
   BUTTONS
   ================================================================ */

.wp-block-button {
    margin: 1.5rem 0;
}

.wp-block-button__link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #3b82f6;
    color: #ffffff;
    text-decoration: none;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.wp-block-button__link:hover {
    background-color: #2563eb;
}

.wp-block-button.is-style-outline .wp-block-button__link {
    background-color: transparent;
    border: 2px solid #3b82f6;
    color: #3b82f6;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background-color: #3b82f6;
    color: #ffffff;
}

/* ================================================================
   SPACING UTILITIES
   ================================================================ */

/* Vertical spacing between blocks */
.wp-block {
    margin-bottom: 1.5rem;
}

.wp-block-heading + .wp-block-paragraph {
    margin-top: -0.5rem;
}

/* Remove top margin from first block */
.entry-content > .wp-block:first-child {
    margin-top: 0;
}

/* Remove bottom margin from last block */
.entry-content > .wp-block:last-child {
    margin-bottom: 0;
}

/* ================================================================
   RESPONSIVE TYPOGRAPHY
   ================================================================ */

@media (max-width: 640px) {
    .wp-block-paragraph,
    .wp-block-list li {
        font-size: 0.9375rem;
    }
    
    .wp-block-quote p {
        font-size: 1rem;
    }
    
    .wp-block-pullquote p {
        font-size: 1.25rem;
    }
}

/* ================================================================
   ACCESSIBILITY
   ================================================================ */

/* Focus styles for interactive elements */
.wp-block-button__link:focus,
.wp-block a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Screen reader only text */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
